Still giving error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Still giving error

#include <iostream> using namespace std; int main() { int marks; cin>>"marks"; if (marks>=50) { cout<<"add 10 percent"; } else { cout<<"fail" } return 0; }

29th Oct 2023, 12:31 PM
Haram Abbas
Haram Abbas - avatar
3 Answers
+ 9
Haram Abbas , Little mistake in your code... 1: Remove ` " " `from cin >> "marks"; 2: semicolon is missing in end of `fail`. See this modified version.. https://code.sololearn.com/cdGw08rAa62h/?ref=app
29th Oct 2023, 1:03 PM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 1
you forgot the Semi-Colums and tried to get Input of an string
29th Oct 2023, 9:37 PM
D1M3
D1M3 - avatar
+ 1
on line 6 : you makes marks variable into a string which cause error , cin function can't take input on a string word , you have to create variable to stored inputs on line 13 use semicolon after cout<<"failed" Solution :- × -> cin>>"marks"; √ -> cin>>marks;
30th Oct 2023, 6:11 AM
Alhaaz
Alhaaz - avatar