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
Can 'this' pointer by used in the constructor?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
What are the disadvantages of c language?
What is wild pointer in c with example?
Explain how does free() know explain how much memory to release?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Explain how can I make sure that my program is the only one accessing a file?
How #define works?
Which is more efficient, a switch statement or an if else chain?
How can I find out if there are characters available for reading?
Explain continue keyword in c
What is a scope resolution operator in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
Why main is used in c?
What is the difference between new and malloc functions?