c program for bubble sortvoid mainint


C program for bubble sort:

void main()

{

int i,j,k,a[10],n;

clrscr();

printf("How many values you want to enter\n");

scanf("%d",&n);

 for(i=0;i<=n-1;i++)

 {

 printf(" %d no?\n",i+1);

 scanf("%d",&a[i]);

 }

                for (i=0;i<=n-1;i++)

                for(j=0;j

                 {

                  if (a[j]>a[j+1])

                    { k=a[j+1];

                      a[j+1]=a[j];

                      a[j]=k;

                     }

                  }

 for(i=0;i<=n-1;i++) printf("%d\n",a[i]);

 getch();

 }

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: c program for bubble sortvoid mainint
Reference No:- TGS0174764

Expected delivery within 24 Hours