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

C program for bubble sort:

void main()


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


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




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



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



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

                    { k=a[j+1];





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



Posted Date: 10/18/2012 6:29:56 AM | Location : United States

Related Discussions:- C program for bubble sort, Assignment Help, Ask Question on C program for bubble sort, Get Answer, Expert's Help, C program for bubble sort Discussions

Write discussion on C program for bubble sort
Your posts are moderated
Related Questions
Program is to create a file student.dat: Program is to create a file student.dat which contains all name, roll_no,marks(5 sub) and percentage   class student    {

write a program that adds all numbers from 1 to 200

Question 1: (a) Describe the following objects and condition states: (i) ifstream and ofstream objects (ii) eof(), fail(), bad() and good() functions. (b) Write a C++ pr

The new and delete operators The C language has explained library functions- malloc() and free() for dynamic allocation and de-allocation of memory. C++ gives yet another appro

Question: (a) What is a function? Are functions needed when writing a C program? (b) State one of the advantages to the use of functions. (c) What do you meant by underst

polishing the jewel game with c coding

Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process wi

I need to create a connection to FIFA Ultimate Team 14, I want to utilize C++ specifically for the reason that that is the language I have the most experience in. There are a co

For this assignment, I've provided a data file called 'elevation.mat', which contains the elevation data you'll be working with.   Type load elevation.mat to get the varia