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 the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Write a program which returns the first non repetitive character in the string?
Why static variable is used in c?
c program for searching a student details among 10 student details
Is array name a pointer?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
What is the difference between array and pointer?
What is meant by realloc()?
What is %g in c?
What is a structural principle?
What is an lvalue in c?
Is c object oriented?
How does sizeof know array size?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
Explain the properties of union.