write a c program for greatest of three numbers without
using if statment

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you override a defined macro?

894


What is static memory allocation?

831


What is the difference between if else and switchstatement

1558


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2568


What is a nested formula?

786


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

843


What is the meaning of ?

796


What is volatile c?

760


4. main() { int c=- -2; printf("c=%d",c); }

1556


Explain what is wrong with this program statement? Void = 10;

983


What is a example of a variable?

750


Why we use int main and void main?

775


Explain 'bus error'?

764


What does printf does?

960


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2103