WAP To enetr The User choice Number And creat The Bubble Sort and display decending order

#include<stdio.h>
#include<conio.h>
void main()
{
 /*   Def:->WAP To enetr The User choice Number And creat The
      Bubble Sort and display decending order.*/
      int no[100],i,j,temp,a;
      clrscr();
      printf("\nEnter The number=>");
      scanf("%d",&a);
      for(i=0;i<=a;i++)
      {
    scanf("%d",&no[i]);
      }
      for(i=0;i<=a;i++)
      {
    for(j=0;j<=i-1;i++)
    {
       if(no[j]<=no[j+1])
       {
         temp=no[j+1];
         no[j+1]=no[j];
         no[j]=temp;
       }
     }
       }

       printf("\nThe Decending Order is:->");
       for(i=0;i<=a;i++)
       {
     printf("\n%d",no[i]);
       }
       getch();
}
WAP To enetr The User choice Number And creat The Bubble Sort and display decending order WAP To enetr The User choice Number And creat The       Bubble Sort and display decending order Reviewed by Unknown on 5:34:00 PM Rating: 5

No comments:

Powered by Blogger.