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