Write a c program to sort six numbers and find the largest
one by using the ladder of if-else?
plz do help me
Answer Posted / sandeep kumar yadav. by m.c.a
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f,max;
clrscr();
printf("Enter the six Number \n");
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
if(a>b && a>c && a>d && a>e && a>f)
max=a;
else if(b>a && b>c && b>d && b>e && b>f)
max=b;
else if(c>a && c>b && c>d && c>e && c>f)
max=c;
else if(d>a && d>b && d>c && d>e && d>f)
max=d;
else if(e>a && e>b && e>c && e>d && e>f)
max=e;
else if(f>a && f>b && f>c && f>d && f>e)
max=f;
printf("\n\n Maximum Number is = %d",max);
getch();
}
| Is This Answer Correct ? | 35 Yes | 9 No |
Post New Answer View All Answers
Explain about C function prototype?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
please send me the code for multiplying sparse matrix using c
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What standard functions are available to manipulate strings?
How do I create a directory? How do I remove a directory (and its contents)?
How to declare pointer variables?
Explain what is #line used for?
What is the difference between a string and an array?
What is void pointers in c?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What is integer constants?
How can I read/write structures from/to data files?
Are comments included during the compilation stage and placed in the EXE file as well?
is it possible to create your own header files?