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 |
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Does c have class?
What's a good way to check for "close enough" floating-point equality?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
without using control structures and control structures find the max and min of given 2 nos
How to removing white spces in c programming only bu using loops
What are the different types of storage classes in C?
What is difference between static and global variable in c?
What is a buffer in c?
what is the program to display your name in any color?
What are the properties of union in c?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical