logo
logo
Sign in

C if...else Statement

avatar
Tech Mekrz
C if...else Statement

If the test expression is evaluated to true (nonzero), statements inside the body of if is executed.

If the test expression is evaluated to false (0), statements inside the body of if is skipped from execution.

Example #1: C if statement

// Program to display a number if user enters negative number

// If user enters positive number, that number won't be displayed

// Test expression is true if number is less than 0

collect
0
avatar
Tech Mekrz
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more