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 are the advantages and disadvantages of a heap?
How do you define CONSTANT in C?
Explain Basic concepts of C language?
What does c mean before a date?
Why does everyone say not to use gets?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
Where does the name "C" come from, anyway?
Why we use conio h in c?
Explain main function in c?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is pointer to pointer in c?
Explain how does flowchart help in writing a program?
What is identifier in c?