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 |
Design a program using an array that lists even numbers and odd numbers separately from the 12 numbers supplied by a user.
What is the usage of the pointer in c?
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?
if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how?
What is floating point exception error? And what are different types of errors occur during compile time and run time? why they occur?
Where can I get an ansi-compatible lint?
write a c program that prints all multiples of 3between 1 and 50.
how to impliment 2 or more stacks in a single dimensional array ?
1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?
in one file global variable int i; is declared as static. In another file it is extern int i=100; Is this valid ?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What is the c language function prototype?