need help with error with my code

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

}
thank you so much man
closed account (Dy7SLyTq)
did you ever program in python? those mistakes look pythony
Topic archived. No new replies allowed.