Friday 30 August 2013

Conditional Operator | C Programming Language Tutorial pdf



Conditional Operator:

Conditional Operator is used to check a condition and Select a Value depending on the Value of the condition.
Variable = (condition)? Value 1 : Value 2:
If the Value of the condition is true then Value 1 is e valued assigned to the varable, otherwise Value2.

Eg: 
big = (a>b)? a:b;
This exxp is equal to
if (a>b)
big = a;
else
big = b;

0 comments:

Post a Comment

 

C Programming Language Interview Questions and Answers Tutorial for beginners. Copyright 2013 All Rights Reserved