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
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
How can a string be converted to a number?
Explain what is the difference between text files and binary files?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is the difference between a function and a method in c?
What is the best way to store flag values in a program?
What is a nested loop?
What are the similarities between c and c++?
What is a pointer value and address in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
Can we replace the struct function in tree syntax with a union?
Can we use any name in place of argv and argc as command line arguments?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What are header files and what are its uses in C programming?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question