HOME

Start

Control Statements

Array

Function

Structure

Pointer

File

Projects

 

 

 

 

 

 

C programing

Ckalari.com is the No.1 website to get the best of C programs, free source codes, projects in c language……  

Buble sorting in c language

#include<stdio.h>

#include<conio.h>

void main()

     {

    int i,j,limit,num[100],temp;

    clrscr();

    printf("\nWhat is the limit OR how many numbers\n");

    scanf("%d",&limit);

    printf("Enter the numbers\n");

    for(i=0;i<limit;i++)

    {

      scanf("%d",&num[i]);

    }

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

    {

      for(j=0;j<limit-1;j++)

      {

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

        {

          temp=num[j];

          num[j]=num[j+1];

          num[j+1]=temp;

        }

      }

    }

    printf("After process\n\n\n");

    for(i=0;i<limit;i++)

    {

       printf("%d ",num[i]);

    }

    getch();

     }

Copyright © 2007-2008 www.ckalari.com