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
What is context in c?
What are 3 types of structures?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Which is the memory area not included in C program? give the reason
What are the uses of null pointers?
What is wrong with this statement? Myname = 'robin';
Tell me can the size of an array be declared at runtime?
Explain the difference between #include "..." And #include <...> In c?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What are the different types of C instructions?
What is the difference between typedef struct and struct?
Compare interpreters and compilers.
What are the rules for identifiers in c?
Where is volatile variable stored?
Is c easy to learn?