Wap by using conditional operator to find largest among three numbers
Answers
Answered by
0
Answer:
Biggest Of Three Numbers Using Conditional operator/Ternary Operator in C
# include <stdio.h>
void main()
{
int a, b, c, big ;
printf("Enter three numbers : ") ;
scanf("%d %d %d", &a, &b, &c) ;
big = a > b ? ( a > c ? a : c) : (b > c ? b : c) ;
printf("\nThe biggest number is : %d", big) ;
Answered by
0
Answer:
Write a c program to find the largest among three numbers using conditional operator.
Explanation:
#include<stdio.h>
int main(){
int a,b,c,big;
printf("\nEnter 3 numbers:");
scanf("%d %d %d",&a,&b,&c);
big=(a>b&&a>c?a:b>c?b:c);
printf("\nThe biggest number is: %d",big);
return 0;
}
Similar questions
Computer Science,
6 months ago
Math,
6 months ago
Art,
6 months ago
Computer Science,
11 months ago
Math,
1 year ago