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 a #include preprocessor?

1224


What is an array in c?

1097


What is your stream meaning?

1336


Calculate 1*2*3*____*n using recursive function??

2099


Write a C program to count the number of email on text

1969


How can I rethow can I return a sequence of random numbers which dont repeat at all?

1240


How can I call a function with an argument list built up at run time?

1287


How can a process change an environment variable in its caller?

1239


If I have a char * variable pointing to the name of a function ..

1231


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1130


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1151


What is difference between && and & in c?

1157


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1324


What does c mean in basketball?

1048


Explain the difference between exit() and _exit() function?

1213