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

Which control loop is recommended if you have to execute set of statements for fixed number of times?

811


Which function in C can be used to append a string to another string?

648


how to create duplicate link list using C???

2075


Compare array data type to pointer data type

600


What is preprocessor with example?

589






Should I learn data structures in c or python?

583


How can you invoke another program from within a C program?

618


How can I open files mentioned on the command line, and parse option flags?

596


What does 3 mean in texting?

617


How do we open a binary file in Read/Write mode in C?

680


What are the differences between Structures and Arrays?

612


What do you mean by command line argument?

647


Is it cc or c in a letter?

568


what are the 10 different models of writing an addition program in C language?

1441


How can you determine the size of an allocated portion of memory?

746