Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain about C function prototype?

1038


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

1898


please send me the code for multiplying sparse matrix using c

2135


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

1005


What standard functions are available to manipulate strings?

1101


How do I create a directory? How do I remove a directory (and its contents)?

1118


How to declare pointer variables?

1185


Explain what is #line used for?

1022


What is the difference between a string and an array?

1172


What is void pointers in c?

971


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

1180


What is integer constants?

1030


How can I read/write structures from/to data files?

935


Are comments included during the compilation stage and placed in the EXE file as well?

1041


is it possible to create your own header files?

1062