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

What is the purpose of type declarations?

1072


What is data type long in c?

1023


Is fortran still used today?

1036


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3014


What are the standard predefined macros?

1067


What is c language in simple words?

1006


What is the explanation for cyclic nature of data types in c?

1137


What is difference between arrays and pointers?

1010


What are the key features in c programming language?

1003


How do you determine whether to use a stream function or a low-level function?

1079


What are the primitive data types in c?

1006


Which of these functions is safer to use : fgets(), gets()? Why?

1042


What are reserved words?

1044


What is time complexity c?

939


What are the uses of null pointers?

1031