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
How do you construct an increment statement or decrement statement in C?
int far *near * p; means
What is a substring in c?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Are global variables static in c?
Can you write the function prototype, definition and mention the other requirements.
What is methods in c?
What are the uses of a pointer?
Differentiate between a for loop and a while loop? What are it uses?
When was c language developed?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What does it mean when a pointer is used in an if statement?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the heap in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include