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

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

 }

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
processing two jobs through 2 machine

want the codings for these topic in ur experts minds.com

How can I handle a destructor that fails? Need help please provide example also.

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

A: No.       While realloc() need to copy the allocation, this uses a bitwise copy operation, that will tear several C++ objects to shreds. C++ objects must be allowed to copy t

write a program to find the area under the curve y=f(x) between x=a & x=b

Want a scraping program created Project Description: We need to hire a professional developer to scrape the site for information such as *product title *Product Price

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw

People sometimes give their phone numbers using one or more alphabetic characters. Create a program that converts the alphabetic characters to their corresponding numbers. For exam

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4