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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Not all reserved words are written in lowercase. TRUE or FALSE?

719


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

631


What is the value of h?

593


Write a progarm to find the length of string using switch case?

1612


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3056






What are the advantage of c language?

552


What is the difference between #include

and #include “header file”?

552


Explain the difference between malloc() and calloc() in c?

578


Explain what are bus errors, memory faults, and core dumps?

791


can anyone suggest some site name..where i can get some good data structure puzzles???

1643


Which is best book for data structures in c?

599


What are the types of functions in c?

572


Can the size of an array be declared at runtime?

610


How are 16- and 32-bit numbers stored?

725


How can you increase the allowable number of simultaneously open files?

597