I have the following code:
#include <cstdlib>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int a,n,count;
count=0; randomize();
a=1+random(100);
cout<<"Enter A No. Between 1 to 100";
do
{
cin>>n;
count++;
if(n>a)
cout<<"Enter a lower no.";
else if(n<a)
cout<<"Enter a higher no.";
}while(n!=a);
cout<<count;
system("PAUSE");
return EXIT_SUCCESS;
}
The errors are:
- E:\c++\main.cpp In function `int main()':
- 10 E:\c++\main.cpp `randomize' undeclared (first use this function)
- (Each undeclared identifier is reported only once for each function it appears in.)
- 11 E:\c++\main.cpp `random' undeclared (first use this function)
Can anyone help me understand why these errors are occurring?