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

What is meant by inheritance?

622


Is that possible to add pointers to each other?

888


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1514


Is fortran still used in 2018?

585


How do I send escape sequences to control a terminal or other device?

600






What is the best way of making my program efficient?

560


What is the difference between fread buffer() and fwrite buffer()?

665


What are called c variables?

569


Can we replace the struct function in tree syntax with a union?

769


What is the use of putchar function?

644


what is the diffrenet bettwen HTTP and internet protocol

1383


What is the difference between if else and switchstatement

1307


How many data structures are there in c?

609


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

645


Why do we use int main?

598