i have some kind of code in the error but i have searched and looked i do not no what is wrong i am getting this erro message :error C2065: 'loop' : undeclared identifier but i thought that you did not have to id loop they are not a varibale
#include <iostream>
#include <cstdlib>
using std::cout;
using std::rand;
int flip();
int main()
{
int coinToss;
int heads, tails;
heads = 1;
tails = 0;
coinToss = 100;
for(loop=0; loop<5; loop++){
for (int toss = 0; toss < coinToss; toss++)
{
flip();
if (flip()== 1)
heads = heads + 1;
else
tails = tails + 1;
}}
return 0;
cout << "Heads appear " << heads << " times.\n";
cout << "Tails appear " << tails << " times.\n";
return 0;
}
int flip()
{
return rand() % 2;
}