Shopping In MUMBAI

Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top. Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.

Monday, December 29, 2008

C program to sort strings in descending order.

Write a c program to sort strings in descending order.

#include
#include
int main()
{
int sort[10],i,j,t;
printf("\n\nEnter 10 Elements In Array To Sort In Descending Order :\n\n");
for(i=0;i<10;i++)
scanf("%d",&sort[i]);
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(sort[i]>sort[j])
{
t=sort[i];
sort[i]=sort[j];
sort[j]=t;
}
}
}
printf("Array Elements in Descending Order Are :");
for(i=9;i>=0;i--)
{
printf("%d\n",sort[i]);
}
getch();
return 0;
}


/*Output
Enter 10 Elements In Array To Sort In Descending Order :

20
36
5
2
7
9
13
52
45
63
Array Elements in Descending Order Are :63
52
45
36
20
13
9
7
5
2
*/

C program to sort strings in descending order.SocialTwist Tell-a-Friend

0 comments:

SUPPORT THIS BLOG