What would you like to do?

Write a C program to arrange 7 numbers in ascending order?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

#include<stdio.h>
#include<conio.h>
main()
{

int x;
printf("Enter the max number of array: ");
scanf("%d", &x);



int i;
int j;
int temp;
int a[x];



system("cls");
printf("Enter %d integer numbers: \n", x);
for(i=0;i<x;i++)
scanf("%d",&a[i]);
for (i=0;i<x;i++)
{
for(j=i+1;j<x;j++)
{
if(a[i]<a[j])
{
temp = a[j];
a[j] = a[i];
a[i] = temp;
}
}
}
printf("\n\nThe %d numbers sorted in ascending order are: \n", x);
int y = x - 1;


for(i=y;i>=0;i--)
printf("%d\t",a[i]);
getch();
}
// this is a converted to c code, this program will allow you to input how many numbers you want and having the same result. as the other one ...

note: thank you wherever you are for writing this code thanks a lot!!!
9 people found this useful
Thanks for the feedback!

Java program to arrange any numbers in ascending order?

import java.util.*; class table { public static void main (String argsp[]) { Scanner in = new Scanner (System.in); int a,b,c,d=0; System.out.print ("\\n\\t Enter the number to

C program to arrange any numbers in ascending order?

include #include void main() { int n ,i,j,temp,a[12]; //in a[] specify some number . printf("Enter the no of inputs:"); scanf("%d", &n); printf("Enter %d integ

Write a program to arrange a list of numbers in ascending order?

include    int main()   {   int num[100];   printf("please input your numbers.enter any letter for the end\\n");   int i=0,j=0,k=0;  

Write a program in c to sort an array in ascending order?

include  #include   int main()  {  char str[100],temp;  int i,j;  clrscr();  printf("Enter the string :");  gets(str);  printf("%s