cplusplus:selection_examples
This is an old revision of the document!
Table of Contents
Control Structures: Selection examples
if
- if_example.cpp
#include <iostream> using namespace std; int main() { int grade; cout << "Enter a grade and I will tell you if you passed: "; cin >> grade; if (grade > 60) cout << "Passed!" << endl; return 0; }
if/else
Nested if/else
cplusplus/selection_examples.1359856670.txt.gz · Last modified: 2013/02/03 01:57 by mithat