Muhammad Magdi
You know that there are 3 types of triangles according to their sides.
You are given 3 integer numbers
(a, b, c) representing the lengths of the sides of a triangle.
Print the type of this triangle according to its sides.
Equilateral
Isosceles
Scalene
if ( CONDITION ) {
TRUE-STATEMENTS
}
When the CONDITION is true, the TRUE-STATEMENTS inside the if-body are executed.
Operator | Meaning |
---|---|
== | equal to |
!= |
not equal to |
< | less than |
> | greater than |
<= | less than or equal |
>= | greater that or equal |
#include <iostream> using namespace std; int main() { int num; cin >> num; if (num == 100) { cout << "It's a Hundred!" << endl; } cout << "Bye" << endl; return 0; }
When the CONDITION is true, the TRUE-STATEMENTS inside the if-body are executed, otherwise the FALSE-STATEMENTS inside the else-body are executed.
if ( CONDITION ) {
TRUE-STATEMENTS
} else {
FALSE-STATEMENTS
}
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x%2 == 0) { cout << "You entered an Even Number!" << endl; } else { cout << "You entered an Odd Number!" << endl; } return 0; }
Months:
January February March April May June July August September October November December