calculate the largest of two numbers using ternary operator in c
Answers
Answered by
3
Program to find largest among two numbers using ternary operator in c
#include<stdio.h> #include<conio.h> int larger(int a, int b); void main() { int x, y, large; printf("\n Enter two numbers:"); scanf("%d%d", &x,&y); large = larger(x,y); printf("\n Larger number is %d",large); getch(); } int larger(int a, int b) { return a>b?a:b; }
#include<stdio.h> #include<conio.h> int larger(int a, int b); void main() { int x, y, large; printf("\n Enter two numbers:"); scanf("%d%d", &x,&y); large = larger(x,y); printf("\n Larger number is %d",large); getch(); } int larger(int a, int b) { return a>b?a:b; }
Answered by
0
ఢలగదఝదగవఠఫశథఝధగశఢవబథఝోఛూజనడవఝలఝ
Similar questions