if...else Statement is a composite statement used to make a decision between two alternatives
Source Code:
Result:
Source Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <iostream.h> #include <conio.h> int main() { cout << " Please enter two integer: "; int a, b; cin >> a >> b ; if (a <= b) cout << a << " <= " << b << endl; else cout << a << " > " << b << endl; getch (); return 0; } //main |
Result:
Please enter two integer: 23 45 23 <= 45
No comments:
Post a Comment