Search C Program

Find largest value among three variable - conditional operator

/*    Find largest value among three variable using conditional operator    */

#include<stdio.h>
int main()
{
 int a,b,c,d;

 printf("Type values of A,B and C : ");
 scanf("%d %d %d",&a,&b,&c);
 d=(a>=b?a>=c?a:c:b>=c?b:c);
 printf("Greatest value : %d",d);
 return 0;
}

Related Posts
Largest value among three variables
http://cbasicprogram.blogspot.in/2012/02/largest-value-among-three-variables.html

Largest among 3 variables using nested if
http://cbasicprogram.blogspot.in/2012/02/largest-among-3-variables-using-nested.html

1 comment:

  1. yahan aapko iska output bhi dena chahiye aur flow chart aur theory

    ReplyDelete