Skip to main content

Command Palette

Search for a command to run...

If And Else Conditions

Published
1 min read
If  And  Else  Conditions

C++ has the following conditional statements: Use if to specify a block of code to be executed, if a specified condition is true. Use else to specify a block of code to be executed, if the same condition is false. Use else if to specify a new condition to test, if the first condition is false.

Examples:-

Vowel and Consonant

Input

Output

Determine the Grade based on marks

Input

Output

Check if a year is a leap year

Input

Output

Find the largest of three numbers

Input

Output