c++ quetion

Write your question here.

C++ i need this answer asap

Fix all syntax error in this program. Submit the correct program and clearly state which lines had problem and what the problems were.
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

string generateBall (); //function to generate random number

main ()

{
strin color;
char end;
srand(time(0));

while(cin){
color = generateBall;
cout << "You got a " << color << " Ball"<< endl;
cin >> end;
}

system ("PAUSE");
return 0;

}

string generateBall()
{
string color;
randnum = (rand()%9);
if (randnum <=4)
color="Red"
else
color = "Blue";

return color;
}
There is such thing as a compiler. Compile your program and the compiler will report all syntax errors.
Where is the question? Seems like you need to do your own exam or do all of us who actually want to learn a favor and find a new career
Topic archived. No new replies allowed.