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...

Find the highest of three numbers and print them using ascending orders?

Answer Posted / venugopal

#include<stdio.h>
main()
{
int a[3],i,f,s;
clrscr();
printf("enter 3 no's");
for( i=0;i<3;i++)
{
scanf("%d",&a[i]);
}
/* sorting starts here*/

for (f=0;f<3;f++)
{
for(s=f+1;s<3;s++)
{
if(a[s]<a[f])
{
temp=a[s];
a[s]=a[f];
a[f]=temp;
}
}
}
/* now sorted array is*/
for(int x=0;x<3;x++)
{
printf("%d",a[x]);
}
/* biggest elt is*/

printf("%d",a[2]);
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is null pointer in c?

962


Explain what is the difference between null and nul?

1101


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1920


Why is it usually a bad idea to use gets()? Suggest a workaround.

1722


what is uses of .net

1699


Tell me is null always defined as 0(zero)?

1056


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1144


Why we write conio h in c?

989


What are multibyte characters?

1074


What are the advantages of using linked list for tree construction?

1045


Can variables be declared anywhere in c?

1053


Explain how do you use a pointer to a function?

1070


where are auto variables stored? What are the characteristics of an auto variable?

1034


What does %p mean?

1051


What is the difference between text and binary i/o?

1018