Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Provides two execution paths — one for when the condition is true, and an alternative for when it is false.
if (condition) {
// true branch
} else {
// false branch
}if (n % 2 == 0) {
cout << "Even";
}else {
cout << "Odd";
}int age = 16;
if (age >= 18) {
cout << "Can vote";
} else {
cout << "Too young to vote";
}