what is compilation error in this case?

#include
#include<math.h>
#include<string.h>
using namespace std;
int main()
{
int cases,hints,no;
char oper;
string ans="";
int noo,i=0,j=0;
cin>>cases;
int countt[cases];
while(j<cases)
{
countt[j]=1;
cin>>hints;
i=0;
no=rand();
while(i<hints)
{
cin>>oper>>noo>>ans;
if(oper==’=’)
{
if(noo==no && ans==“No”)
countt[j]++;
if(noo!=no && ans==“Yes”)
countt[j]++;
}
else if(oper==’<’)
{
if(noo<no && ans==“No”)
countt[j]++;
if(noo>=no && ans==“Yes”)
countt[j]++;
}
else if(oper==’>’)
{
if(noo>no && ans==“No”)
countt[j]++;
if(noo<=no && ans==“Yes”)
countt[j]++;
}
i++;
}
j++;
}
for(i=0;i<cases;i++)
{
cout<<countt[i]<<endl;;
}
}

Hello,

Use #include <string> instead of #include <string.h>

Also, you have an extra ; at the line of the cout, possibly the answer line.

Best,

Bruno

The error was " main : rand() was not declared in this scope". You did not include the header file required for using the rand function. Here is a submission of your code where i added a few header files and it showed WA instead of Compilation error.

//