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
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Why dont c comments nest?
Tell us bitwise shift operators?
Distinguish between actual and formal arguments.
What is page thrashing?
Tell me when would you use a pointer to a function?
How can you increase the size of a dynamically allocated array?
What are header files in c programming?
what do you mean by enumeration constant?
What does != Mean in c?
Are c and c++ the same?
List some of the static data structures in C?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Why does this code crash?