C program: Ascending order is a method for arranging given numbers in a sequence manner. You can give any numbers to arrange like wise. It is a simple source program to understand easily. It can be used in all LAB exams and theory exams also.
[Useful: IT Company Details] & [Education Loan Guide]
ASCENDING THREE NUMBERS IN C
Ascending three numbers in C are used to make the three values in an ascending order by using conditional statement. It is useful for in registering a missing number to order it or for marks in revers process.
[Read: IT Related Abroad Studies] & [Bike Back Wordings]
/* Title: Ascending Order
Author: Karthikh Venkat
© http://students3k.com
This website provides lots of useful information for all students.
*/
//Header files
# include<stdio.h>
# include<conio.h>
void main()
{
//Program variables
int value1,value2,value3,temp;
clrscr();//Function is used to clear previous output
printf("Enter first value : ");//Display function
scanf("%d",&value1);//Getting input function
printf("Enter second value : ");
scanf("%d",&value2);
printf("Enter third value : ");
scanf("%d",&value3);
if(value1>value2)//Conditional statement(if statement)
{
temp = value1;
value1=value2;
value2=temp;
}
if((value3>value1)&&(value3>value2))
printf("%d %d %d",value1,value2,value3)
else
getch();
}