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


Please Help Members By Posting Answers For Below Questions

Why is c called c not d or e?

622


Is anything faster than c?

593


What is the use of f in c?

563


What is an endless loop?

814


Explain how do you generate random numbers in c?

628






What are inbuilt functions in c?

566


How are 16- and 32-bit numbers stored?

731


Explain how can a program be made to print the name of a source file where an error occurs?

695


How can I write a function analogous to scanf?

663


‎How to define structures? · ‎

640


Explain what are the different data types in c?

765


How is a structure member accessed?

592


What are dangling pointers? How are dangling pointers different from memory leaks?

633


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

614


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

773