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

What is data structure in c and its types?

589


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3728


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

831


what is a function method?give example?

1910


What is a newline escape sequence?

664






GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

678


Why use int main instead of void main?

590


Explain why c is faster than c++?

568


What is the difference between c and python?

579


Explain how do you determine whether to use a stream function or a low-level function?

619


What is c language used for?

553


What is table lookup in c?

624


What is #include stdlib h?

612


What is calloc()?

623


Can we change the value of static variable in c?

556