Program to find largest of three numbers without using comparsion operator?
Answer Posted / a.naga tirupathi rao
#include <stdio.h>
#include <conio.h>
main()
{
int a[i],sum=0,i,j;
for(i=1;i<=3;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
for(j=sum;j<=sum;j--)
{
for(i=1;i<=3;i++)
{
if(j==a[i])
{
printf("%d is biggest",j);
break;
}
}
}
getch();
}
Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Why is c called c not d or e?
Is anything faster than c?
What is the use of f in c?
What is an endless loop?
Explain how do you generate random numbers in c?
What are inbuilt functions in c?
How are 16- and 32-bit numbers stored?
Explain how can a program be made to print the name of a source file where an error occurs?
How can I write a function analogous to scanf?
How to define structures? ·
Explain what are the different data types in c?
How is a structure member accessed?
What are dangling pointers? How are dangling pointers different from memory leaks?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?