c++ - else if was not declared in this scope -



c++ - else if was not declared in this scope -

i have code , i'm running show error

else if not declared in scope , 1

[error] expected ';' before 'grade' [error] 'else' without previous 'if'

and code where's problem ?

#include <iostream> #include<conio.h> #include <cstdlib> using namespace std; main() { system("cls"); int marks; char grade; cout<<"\n come in marks = "; cin>>marks; if(marks>=80 && marks<=100) grade='a'; elseif(marks>=70 && marks<80) grade='b'; elseif(marks>=60 && marks<70) grade='c'; elseif(marks>=50 && marks<60) grade='d'; else grade='f'; cout<<"\n grade = "<<grade<<endl; getch( ); homecoming 0; }

elseif

should be

else if <<<<< space between else , if

c++ if-statement

Comments

Popular posts from this blog

javascript - I need to update the text of a paragraph by inline edit -

javascript - THREE.js reposition vertices for RingGeometry -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -