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
Can you think of a logic behind the game minesweeper.
Can math operations be performed on a void pointer?
how do you execute a c program in unix.
Is that possible to store 32768 in an int data type variable?
What is return type in c?
How can you increase the size of a statically allocated array?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
What does c mean before a date?
Explain what is a pragma?
What are the data types present in c?
Explain bitwise shift operators?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
Explain high-order and low-order bytes.
How can you call a function, given its name as a string?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.