Compilation Error...! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Compilation Error...!

I was working on a random no program...but when i compiled the program it said that <cstdlib> cannot be extracted... i also tried <cstdlib.h> but it didn't work... ( I use pc for programming... i compile programs in TurboC++)

2nd Sep 2017, 3:13 PM
Prabhjot Khakh
Prabhjot Khakh - avatar
2 Answers
+ 12
In turbo C++ u have to use stdlib.h for random numbers #include <iostream.h> #include <stdlib.h> int main() { int num,i; for(i=0;i<5;++i) { num=rand(); cout<<num<<endl; } }
2nd Sep 2017, 3:21 PM
P R
P R - avatar
+ 1
ok thanks dude
2nd Sep 2017, 3:22 PM
Prabhjot Khakh
Prabhjot Khakh - avatar