If-Else Statement in C Language

if-else Statement in C

If the condition within the parantheses evaluates to true, then, the statement immediately following it is executed; otherwise the statement following the else clause is executed. Given below is a syntax and flowchart depiction of the if-else statement.

Syntax:

Flowchart:

Example:



Output:

 y is greater than x


Read Also: