Problem Solving using C Language

0 of 77 lessons complete (0%)

Conditional Statement

Conditional Expression

 The purpose of the conditional expression is to select one of two expressions depending on a third, boolean, expression. The format for the conditional expression is

 <boolean-expression> ? <expression-1> : <expression-2>

#include <stdio.h>
int main()
{    
	printf("Hello World");    
	int a, b, c;    a=5;b=6;    
	c=a>b?a:b;    
	printf("The Value is: %d\n",c);    
}