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 are pointers? Why are they used?
List the variables are used for writing doubly linked list program.
What is the difference between new and malloc functions?
What is a struct c#?
Difference between goto, long jmp() and setjmp()?
why return type of main is not necessary in linux
What is a const pointer in c?
What is pointer to pointer in c language?
What is strcpy() function?
What are void pointers in c?
What is file in c preprocessor?
Explain logical errors? Compare with syntax errors.
Apart from dennis ritchie who the other person who contributed in design of c language.
What are the types of arrays in c?
Write a program to check prime number in c programming?