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 |
with out using main how to execute the program?
write a program to create a sparse matrix using dynamic memory allocation.
What is variable in c with example?
Why cant I open a file by its explicit path?
what type of questions arrive in interview over c programming?
Explain output of printf("Hello World"-'A'+'B'); ?
Write an algorithm for a program that receives an integer as input and outputs the product of of its digits. E.g. 1234 = 24, 705 = 0
How are structure passing and returning implemented?
Explain is it valid to address one element beyond the end of an array?
Explain how do you declare an array that will hold more than 64kb of data?
What is d scanf?
write a program to add two numbers of any size.....(remember any size)