Variable = (condition)? Value 1: Value 2:
If the Value of the condition is true then Value 1 is e valued assigned to the variable, otherwise Value2.
#include<stdio.h>
void main ()
{
int x=1, y;
Y=(x==1? 2: 0);
Printf (“\n x value is: %d”, x);
Printf (“\n y value is: %d”, y);
}
X value is: 1
Y value is: 2