C++ examples for Operator:Conditional Operator
Grader program demonstrates the use of conditional statements.
#include <iostream> /*w w w .j a v a 2 s . c o m*/ int main() { int grade; std::cout << "Enter a grade (1-100): "; std::cin >> grade; if (grade >= 70) std::cout << "\nYou passed. Hooray!\n"; else std::cout << "\nYou failed. Sigh.\n"; return 0; }