Search & Find out

Thursday, December 3, 2009

Ascending Order


#include "stdio.h"
#include "conio.h"
void main ()
{
    int n[100],i,j,k,no;
    clrscr ();
    printf("Welcome to Ascending order \n\n");
    printf("Enter the number of no.s do u want to give ? : ");
    scanf("%d",&no);

    for (i=0;i
    {
        printf ("\nEnter a number: ");
        scanf ("%d",&n[i]);
    }
    for (i=0;i
    {
        for (j=i+1;j
        {
            if (n[i]>n[j])
            {
                k=n[j];
                n[j]=n[i];
                n[i]=k;
            }
        }
    }
    for (i=0;i
    {
        printf ("%d\n",n[i]);
    }
getch ();
}



Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use