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
In C language, a variable name cannot contain?
What is getch () for?
Where static variables are stored in c?
What are the salient features of c languages?
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
what is bit rate & baud rate? plz give wave forms
How can I use a preprocessorif expression to ?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
hi send me sample aptitude papers of cts?
If you know then define #pragma?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
How do you initialize pointer variables?
What is this infamous null pointer, anyway?
Explain what does the format %10.2 mean when included in a printf statement?