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 C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
Can you write a programmer for FACTORIAL using recursion?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Explain goto?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
How can I manipulate strings of multibyte characters?
how 2 compile & execute c program with out using editor?
differentiate between const char *a; char *const a; and char const *a;
2 Answers College School Exams Tests, HCL, TCS,
how to find turn around time in operating system?
What is Lazy evaluation in C? Give an example.
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above
how to swap two integers 1 and 32767 without using third variable