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

Operator precedence and associatively, Op e r a t o r P r e c e d ...

Op e r a t o r P r e c e d e n c e a n d A s s o c i a t i v e l y : T h e op e r a t o r p r e c e d e n c e a n d i

Padovan string, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2

Program, Data array A has data series from 1,000,000 to 1 with step size 1,...

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

Write a code to implement the base and derived class, Study the given hiera...

Study the given hierarchical class diagram and additional information, and answer the questions that follow: Sale Company: string unitPrice: double

Usb photobackup, Project Description: Prepare software that will work with ...

Project Description: Prepare software that will work with our USB hardware that easily lets you backup all the pictures in your computer into the USB stick in one single step. Once

Write a program to create a binary file, Write a program to create a binary...

Write a program to create a binary file and store the following data "hello", 0x0030,'1', 1.234  Using visual studio examine the binary file and note how the day is stored   Answe

Program, Byteland county is very famous for luminous jewels. Luminous jewel...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Static optimality theorem, Question 1 Describe the following with respect ...

Question 1 Describe the following with respect to pointers in C language- Pointers and Arrays Usage of Pointers in functions Write programs in C to demonstrate the

Boardcoloring, how to fill the blank spaces in the board of 4*4 matrix with...

how to fill the blank spaces in the board of 4*4 matrix with the minimum of 4 colors and the condition is the adjacent element should not have the same colour

What are some ways try / catch / throw can develop software , Q: What are s...

Q: What are some ways try / catch / throw can develop software quality? A: By removing one of the reasons for if statements. The commonly utilized alternative to try / catch

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