Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 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'

and

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

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

here is my code

C++
#include<iostream>
using namespace std;

void main ()

{

	int x;

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

	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";

	}

	else

	{

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

	}

	int y;

	cin>>y;
}
Posted
Comments
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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900