C program for bubble sort, C/C++ Programming

Assignment Help:

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();

 }


Related Discussions:- C program for bubble sort

Padovan string, padovan string for a natural number is defined

padovan string for a natural number is defined

#otto cycle, To get the efficiency of Otto cycle by C/C++.

To get the efficiency of Otto cycle by C/C++.

Explain protected derivation, Protected derivation In addition to doing...

Protected derivation In addition to doing private and public derivations, you may also do a protected derivation. In this situation :   The private members inherited

Car rental payment system, payment system, in c++ only..just use the printf...

payment system, in c++ only..just use the printf or scanf.please

Star, how can i print any english work using star .?

how can i print any english work using star .?

If one won''t explicitly call the destructor of a local then , if one won't...

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

C Program with android, Hello, I would like to know if you can help in C pr...

Hello, I would like to know if you can help in C programs that work on android.

Explain rules for constructing variable names in c language, Explain Rules ...

Explain Rules for constructing variable names? The Rules for constructing variable names : a) A variable name is any combination of alphabets, 0 to 9 digits and undersc

Explain the array types, Array types An array is a collection of object...

Array types An array is a collection of objects of a one data type. The individual objects are accessed by their position in the array. This way of accessing is known as indexi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd