Write a C program to find the smallest of three integers,
without using any of the comparision operators.

Answer Posted / srinivas

#include <stdio.h>

int main(void)
{
int a = 10, b = 2, c = 30, result;

result = a < b ? ((a < c) ? a: c) : ((b < c) ? b : c);
printf("%d\n",result);
return 0;


}

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you please explain the scope of static variables?

608


Why doesnt the call scanf work?

679


What is conio h in c?

630


What are global variables and explain how do you declare them?

582


Which is best linux os?

568






How do you search data in a data file using random access method?

840


How can I dynamically allocate arrays?

600


How can I use a preprocessorif expression to ?

604


What does void main () mean?

738


Why we use void main in c?

600


What is the use of clrscr?

602


What is a memory leak? How to avoid it?

580


Write a program to identify if a given binary tree is balanced or not.

689


What is c basic?

603


How to get string length of given string in c?

611