+ 1

If i want to take input from user and according to that i want to show that person is fail or pass then what i have to do.

include <iostream> using namespace std; int main() { int mark = 90; if (mark < 50) { cout << "You failed." << endl; } else { cout << "You passed." << endl; } return 0; }

17th May 2019, 4:42 PM
Ravi Henry
Ravi Henry - avatar
1 Answer
+ 2
https://code.sololearn.com/cqYQc588Gl0Q/#cpp #include <iostream> using namespace std; int main() { int mark; cout << "Please enter grade: \n"; cin >> mark; if (mark < 50) { cout << "You failed." << endl; } else { cout << "You passed." << endl; } return 0; }
17th May 2019, 4:48 PM
AgentSmith