Pages

Hello there!

Powered by Blogger.

Monday, January 7, 2013

CONDITIONAL OPERATOR IN C


CONDITIONAL OPERATOR IN C WITH EXAMPLE


Conditional operator is alternative to simple if-else statement

Syntax:-

expr1 ? expr2 : expr3

Execution:-

expr1 is always evaluated, if results is true than expr2 is executed otherwise expr3 is executed.

Example:-

Program to find given number as even or odd.

0 comments:

Post a Comment