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 down the program to sort the array.

Answer Posted / rama krishna sidhartha

//code for ascending order
for(i=0;i<n-1;i++)
{
for(j=1+1;j<n;j++)
{
if(a[j] >a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}

//code for descending order
for(i=n-1;i>0;i--)
{
for(j=n;j>i+1;j--)
{
if(a[j]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between Macro and ordinary definition.

1277


Explain what is operator promotion?

1028


What is the use of ?

995


Explain the properties of union. What is the size of a union variable

1132


what type of questions arrive in interview over c programming?

1984


Does free set pointer to null?

955


Why pointers are used in c?

948


What does. int *x[](); means ?

1017


write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.

3771


What is the advantage of a random access file?

1133


Tell us something about keyword 'auto'.

1013


What are the functions to open and close the file in c language?

989


Why c is called top down?

1095


What is integer constants?

1018


What would be an example of a structure analogous to structure c?

947