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 are the types of bitwise operator?

1048


What are the uses of null pointers?

1032


What are the characteristics of arrays in c?

992


How can I call fortran?

992


How can you determine the size of an allocated portion of memory?

1238


Why do we use stdio h and conio h?

1032


How to get string length of given string in c?

1010


What are the types of macro formats?

1059


What is bubble sort technique in c?

932


Explain what is the difference between functions abs() and fabs()?

1098


What are the 5 types of inheritance in c ++?

967


What is the difference between null pointer and wild pointer?

1136


Hai what is the different types of versions and their differences

1897


What is structure in c explain with example?

1090


How can I manipulate strings of multibyte characters?

1077