Compilation Error...! | Sololearn: Learn to code for FREE!

+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++)

9/2/2017 3:13:52 PM

Prabhjot Khakh

2 Answers

New Answer

+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; } }

+1

ok thanks dude