write a c program for greatest of three numbers without
using if statment
Answers were Sorted based on User's Feedback
Answer / sathishmani
void main()
{
int a=10,b=20,c=30,d;
d=((a>b)&&(a>c))?1:2;
switch(d)
{
case 1:
printf("%d",a);
break;
case 2:
d=(b>c)?b:c;
printf("%d",d);
break;
}
}
Is This Answer Correct ? | 68 Yes | 21 No |
Answer / swathi
main()
{
int a,b,c,s1,big;
printf("enter 3 values");
scanf("%d %d %d", &a,&b,&c);
s1=(a>b)? a : b;
big= (s1>c)? s1 : c;
printf("largest of 3 no's=%d",big);
}
Is This Answer Correct ? | 23 Yes | 6 No |
Answer / ragu
int call();
void main()
{
int a,b,c,d;
printf("enter the values");
scanf("%d%d%d",&a,&b,&c);
d=call();
}
call()
{
return(a>b?a>c?a:c:b>c?b:c);
}
Is This Answer Correct ? | 28 Yes | 19 No |
Answer / suresh
main()
{
int a,b,c,big;
printf("enter 3 values");
scanf("%d %d %d", &a,&b,&c);
big= ((a>b)&&(a>c))? a :b>c?b:c;
printf("largest of 3 no's = %d",big);
}
Is This Answer Correct ? | 6 Yes | 2 No |
Write a program to print a (*)pattern programming (A to Z) in capital in one programming ?
Without Computer networks, Computers will be half the use. Comment.
how i m write c program 1.check prime number 2.prime number series
What are the Advantages of using macro
How does #define work?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }
What is graph in c?
what is memory leak?
difference between i++* and *++i
Explain continue keyword in c
Write a program that receives as input a number omaadel-n-print, four digits.