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
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ