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

Dear Sir,
we are required the bubble sorting programs

Regs
Prem

Answer Posted / vignesh1988i

DESCENDING ORDER Bubble sorting

#include<stdio.h>
#include<conio.h>
void main()
{
int a[100],n;
printf("enter the number of elements :");
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n-1;i++)
for(j=0;j<n;j++)
if(a[j]<a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
for(i=0;i<n;i++)
printf("%d\n",a[i]);
getch();
}


thank u

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I get random integers in a certain range?

1070


Tell us something about keyword 'auto'.

1074


What is the ANSI C Standard?

1277


What is c mainly used for?

1069


Explain data types & how many data types supported by c?

1085


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2295


What is meant by keywords in c?

1073


What is malloc return c?

1033


Which is better pointer or array?

1032


Can you assign a different address to an array tag?

1177


What is oops c?

1255


How main function is called in c?

1128


What is main () in c?

1078


What is ## preprocessor operator in c?

1094


What does the characters “r” and “w” mean when writing programs that will make use of files?

1486