elibraryportal Logo

If Statement in C

if statement is used to test the condition, if condition is true then the statement is executed ,and If the condition is false then the statements inside if body are completely ignored.

Example 1:) Print the Even Number in C

Output

Enter a number:4
4 is even number
enter a number:5

Example 2:) Find the largest number .

Output

Enter three numbers?
12 23 34
34 is largest 

Example 3:) Find the biggest of two number .

Output

Enter two numbers: 5 8
Biggest  numbers is 8
Next Topic