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 |
Is struct oop?
How old is c programming language?
What is array of structure in c programming?
Software Interview Questions
Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.
Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.
1 What is a Data Structure?
what is develop in c language
what is mallloc()?how it works?
write a program for size of a data type without using sizeof() operator?
22 Answers HCL, IBM,
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]
what is the difference between auto and static keywords
1 Answers cDot, College School Exams Tests, TCS,