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 how can you be sure that a program follows the ansi c standard?
How will you divide two numbers in a MACRO?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is wild pointer in c?
write an algorithm to display a square matrix.
How can you invoke another program from within a C program?
What is the difference between text and binary modes?
Explain setjmp()?
which is an algorithm for sorting in a growing Lexicographic order
Is that possible to store 32768 in an int data type variable?
How to throw some light on the b tree?
Can we access array using pointer in c language?
Explain what are the different data types in c?
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