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


Please Help Members By Posting Answers For Below Questions

In C language, a variable name cannot contain?

734


What is getch () for?

670


Where static variables are stored in c?

581


What are the salient features of c languages?

618


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

662






what is bit rate & baud rate? plz give wave forms

1512


How can I use a preprocessorif expression to ?

593


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

660


hi send me sample aptitude papers of cts?

1647


If you know then define #pragma?

670


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜nā€™ element.

1576


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

662


How do you initialize pointer variables?

603


What is this infamous null pointer, anyway?

605


Explain what does the format %10.2 mean when included in a printf statement?

769