Click here to Skip to main content
14,545,215 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi, I am new to c++. Only been doing it for a few days and I am enjoying it very much.

I am getting this error on one of my practice codes I'm writing.

syntax error : missing ';' before 'string'


syntax error : missing ';' before identifier 'cin'

but i dont see a spot where i missed ending the line

here is my code

using namespace std;

void main ()


	int x;

	cout<<Enter the number grade of a student\n";

	if (x >= 90)

	cout<<"Grade: A\n";

	else if (x >= 80)


		cout<<"Grade: B\n";


	else if (x >= 70)


		cout<<"Grade: C\n";


	else if (x >= 60)


		cout<<"Grade: D\n";




		cout<<"You have recieved an F\n";
		cout<<"You must retake the clas to recieve credit loser\n";


	int y;

Maciej Los 11-Aug-13 18:22pm
Do not repost: Help with this code please.[^]! Instead posting new question, use "Improve question" wigdet. Please, delete it to avoid down-voting.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You are missing a " on your first cout line, just after the stream direction.
Maciej Los 11-Aug-13 18:27pm
Hawk eye ;)
Ron Beyer 11-Aug-13 19:14pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100