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 c system32 taskhostw exe?
Explain low-order bytes.
Where register variables are stored in c?
How does selection sort work in c?
What is extern storage class in c?
What are enumerated types?
How can I find out if there are characters available for reading?
What are the two types of functions in c?
Why is c so popular?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is meant by operator precedence?
What is difference between structure and union with example?
code for quick sort?
What are the benefits of organizational structure?