LARGEST OF TWO NUMBERS USING TERNARY OPERATOR - C PROGRAMMING - Code Developer Pro

Breaking

Code Developer Pro

Solutions to all coding problems

Like us on Facebook

test banner

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Thursday, 17 December 2015

LARGEST OF TWO NUMBERS USING TERNARY OPERATOR - C PROGRAMMING

How to find largest of two numbers using ternary operator?



Solution


#include<stdio.h>
void main()
{
      system("clear");
      int a,b;
      printf("enter the two numbers");
      scanf("%d%d",&a,&b);
   (a>b)?printf("the largest number is %d",a):printf("the largest number is %d",b);
}


Thanks & Regards,
Anju Soosan George
Assistant Professor

No comments:

Post a Comment

Post Top Ad

Responsive Ads Here