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 |
program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
What is the difference between array and pointer?
Write a program in c to replace any vowel in a string with z?
Is c is a high level language?
Determine if a number is a power of 2 at O(1).
How would you rename a function in C?
What is the meaning of 2d in c?
what will be the output of this program main() { int i=1; while (i<=10); { i++; } }
WAP – represent a char in binary format
What is the difference between variable declaration and variable definition in c?
Write a program to find minimum between three no.s whithout using comparison operator.
main() { float a=8.8; double b=8.8; if(a==b) printf("Equal"); else printf("not equal"); getch(); } what is the output? with reason