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!
Follow

You recently celebrated 4 years of sobriety. Congratulations on such a huge milestone! Do you still have temptations today?

View Full Interview
In Math

Foolproof Ways to Make Numbers Fun for Elementary Students

The educational path to becoming an elementary school teacher is filled with tips and techniques to help teachers generate interest and capture the attention of young students (MORE)
In Grammar

Addressing the Dilemma of Using Numbers in Writing

If your writing piece includes the description of numbers or dates, you may find yourself wondering how to express them. Many sources vary on this topic but the one rule that (MORE)

Wedding Programs That Create Memories

Designing a wedding program that can help create memories, can be done in so many ways. The order to the wedding program can play a big part in how memorable it is. Nothing wi (MORE)

Requirements for Writing Numbers on Checks

A check is a secure way of sending money to other people. Checks are a good alternative to cash, which may not be secure to carry around in large amounts. The other reason for (MORE)

Arrange Furniture the Proper Way

Many elements go into decorating a room. You need to choose the right color scheme and the right furniture, and then you need to arrange the furniture to enhance the space. A (MORE)

What would you like to do?

Write a program to find the largest of three numbers and print the output in ascending order?

void main() { int a,b,c; clrscr(); printf("Enter the value of a:"); scanf("%d",&a); printf("\\nEnter the value of b:"); scanf("%d",&b); printf("\\nEnter the value of c:"); sca (MORE)

What would you like to do?

How do you write a java program to sort n numbers in ascending order?

It should be fairly simple to program a bubble sort (though this is not very efficient for large arrays). If elements #0 and #1 of an array are out of order, exchange them. Th (MORE)