Wednesday, December 25, 2013

write a C Program to arrange 10 numbers in ascending order

C Program to arrange 10 numbers in ascending order





/*C Program to arrange 10 numbers in ascending order*/


#include<stdio.h>

#include<conio.h>

void main()

{

int i,j,temp,a[10];

clrscr();

printf(Enter 10 integer numbers: \n);

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

scanf(%d,&a[i]);

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

{

for(j=i+1;j<10;j++)

{

if(a[i]>a[j])

{

temp=a[j];

a[j]=a[i];

a[i]=temp;

}

}

}

printf(“\n\nThe 10 numbers sorted in ascending order are: \n);

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

printf(%d\t,a[i]);

getch();

}




OUTPUT:


Enter 10 integer numbers:

2

9

7

4

3

6

8

1

5

10

The 7 numbers sorted in ascending order are:

1     2       3       4       5            6       7       8       9      10





------------------------------------------------
Answers questions like


   
Write a c program to sort 10 numbers in ascending order
Write a program to arrange a list of numbers in ascending order
How to write a program for arranging numbers in ascending order
Write a c program to arrange numbers in ascending order
C++ Arrange 10 random integers in descending order? 
Write a C program to sort a string in ascending order.?
Program to sort numbers in ascending order and use integer point
Sort 10 Numbers In Ascending Order - C And C++
Write a simple program in java to accept 10 number