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 .

Write a C program to arrange 7 numbers in ascending order?
#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 have performed many times for a variety of audiences, including for British troops in Iraq and Afghanistan. What has been your most memorable performance?

View Full Interview

Write a c program to arrange the digits of a number in ascending order?

Computer programmers use an array to arrange digits of a number in  ascending order. The program uses character array to store the  digits and a quick sort feature to sort t

Write a c program to sort 10 numbers in ascending order?

#include#include void main() { int num[10],i,j,temp; clrscr(); printf("\\n Enter 10 values of an array.....\\n"); for(i=0;i
Java program to arrange any numbers in ascending order?

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?

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?

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
Write an assembly language program for arranging nos in the ascending order?

Write an assembly language program for arranging nos in the ascending order?

Data Segment arr1 db 8,2,7,4,3   Data Ends     Code Segment   Assume cs:code, ds:data     Begin:   mov ax, data   mov ds, ax   mo

How do you write a program in C to ascend n numbers?

  #include main() { int n,i,j,a[10][10],t; clrscr(); printf("enter the limit of an array\\n"); scanf("%d",&n); printf("enter the elments of an array\\n");