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
What is a const pointer in c?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is calloc()?
What is data types?
Can math operations be performed on a void pointer?
Is swift based on c?
What is c language in simple words?
How can I sort a linked list?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What are the different types of constants?
How do I get an accurate error status return from system on ms-dos?
Why string is used in c?
Difference between linking and loading?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What is use of null pointer in c?