Dear Sir,
we are required the bubble sorting programs
Regs
Prem
Answer / 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 |
Why & is used in c?
What are the standard predefined macros?
What are header files in c?
main() { int i = 10; printf(" %d %d %d \n", ++i, i++, ++i); }
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
How are variables declared in c?
Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
how can we Declare a variable in c without defining it.
Hai what is the different types of versions and their differences
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Hai why 'c' is the middle language
What is volatile keyword in c?