Write a C program to find the smallest of three integers,
without using any of the comparision operators.
Answer Posted / niranjan
main()
{
int a=5,b=2,c=3; /*Assuming a Use Case */
int d; /* d is required a temporary variable */
if(!(a/b)&& !(a/c))
{
d = a; /* Which means a is small */
}
else if ( !(b/a)&&!(b/c))
{
d = b; /* Which means b is small */
}
else
{
d = c;
}
printf("%d",d);
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is the use of void pointer and null pointer in c language?
Why does the call char scanf work?
How can I find the modification date of a file?
Tell me with an example the self-referential structure?
How do I send escape sequences to control a terminal or other device?
What is ctrl c called?
What is the right way to use errno?
What are reserved words?
Is null always equal to 0(zero)?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Why is C language being considered a middle level language?
What is a stream water?
What are near, far and huge pointers?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
Explain the difference between structs and unions in c?