Write a C program to find the smallest of three integers,
without using any of the comparision operators.
Answer Posted / n r sree harsha
#include<stdio.h>
#include<math.h> /* for using abs() function */
main()
{
int a,b,c,small;
printf("\n enter numbers");
scanf("%d%d%d",&a,&b,&c);
if(abs(a-b)-(a-b))
{
if(abs(a-c)-(a-c))
{
s=a;
else
s=c;
}
else
{
if(abs(b-c)-(b-c))
{
s=b;
else
s=c;
}
}
printf("\n small=%d",s);
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Can you please explain the difference between strcpy() and memcpy() function?
What is bubble sort technique in c?
What are reserved words with a programming language?
what do u mean by Direct access files? then can u explain about Direct Access Files?
Tell us bitwise shift operators?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
What is the difference between test design and test case design?
Can true be a variable name in c?
Write a program to show the change in position of a cursor using c
Write a program to generate the Fibinocci Series
Is main an identifier in c?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Can one function call another?
What does calloc stand for?