Program to find largest of three numbers without using comparsion operator?
Answers were Sorted based on User's Feedback
#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 |
Answer / sanjay bhosale
Both programs mentioned above produce wrong results when some numbers are positive and others are negatives.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / arunslb123
ct=0;
while(var1 && var2 && var3){
var1++;
var2++;
var3++;
ct--;
}
printf("%d",ct);
could u pls explain this
| Is This Answer Correct ? | 5 Yes | 6 No |
How to find the given no is odd or even without checking of any condition and loops. (Hint: Using array)
write a program to display all prime numbers
What is structure packing in c?
What is nested structure?
why Language C is plateform dependent
Are the variables argc and argv are local to main?
what does ‘segmentation violation’ mean?
Differentiate between a structure and a union.
What is the total generic pointer type?
What are extern variables in c?
Give a fast way to multiply a number by 7
15 Answers Accenture, Aricent, Microsoft,
What is #line used for?