need help with error with my code

Jul 8, 2013 at 6:52am
i cant figure out the error with this code im a beginner so i know its probably a easy solution can someone please tell me the solution

here's the code

#include <iostream>
using namespace std;
int main()
{
int grade = 0
cout << "type your grade here: " << endl;
cin >> grade;
if grade >= 94;
cout <<"you have a A" <<endl;
if() grade <= 86
cout << "you have a B" endl;


}
Last edited on Jul 8, 2013 at 6:56am
Jul 8, 2013 at 7:13am
There were a few syntax problems with your C++ code I put some comments to show where they are.

#include <iostream>
using namespace std;
int main()
{
int grade = 0; //You were missing the semicolon
cout << "type your grade here: " << endl;
cin >> grade;
if (grade >= 94 ) // the logic statement need to be inside the parentheses
cout <<"you have a A" <<endl;
if (grade <= 86 ) // the logic statement need to be inside the parentheses
cout << "you have a B" << endl; //you were missing the << between the string and the endl in the cout statement

}
Jul 8, 2013 at 7:15am
thank you so much man
Jul 8, 2013 at 7:23am
closed account (Dy7SLyTq)
did you ever program in python? those mistakes look pythony
Topic archived. No new replies allowed.