Saturday, 30 December 2017

C program to find largest among 3 numbers using conditional operator.

#include<stdio.h>
int main( )
{
    int num1, num2, num3, large, temp;

   printf("Enter the number");

   scanf("%d %d %d",&num1,&num2,&num3);

   temp=(num2>num3)?num2:num3;

  
   large=(num1>temp)?num1:temp;

printf("Largest among 3 is %d ", large);


return 0;

}




No comments:

Post a Comment

Featured Post

TCS Latest Test Patern ( For On-Campus Drives )

Tata Consultancy Services is software services consulting company whose  headquarter is situated in Mumbai, India. It is the Asia’s larges...