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


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

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

printf("Enter %d integer numbers: \n", x);
for (i=0;i<x;i++)
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;

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

Are you still dating mystery boyfriend Patrick? Why do you prefer to keep your romantic life private these days?

View Full Interview

Write a c program to sort the elements of the matrix in ascending order?

include<stdio.h>   main()   {   printf("Enter Order Of The Matrix\\n");   int l,m;   int i,j,k,t,x;   scanf("%d%d",&l,&m);   int a[l] (MORE)

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

include<stdio.h> #include<conio.h> void main() { int i,j,temp,a[7]; clrscr(); printf("Enter 7 integer numbers: \\n"); for(i=0;i<7;i++) scanf("%d (MORE)
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)

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 (MORE)

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

#include<stdio.h>#include<conio.h> void main() { int num[10],i,j,temp; clrscr(); printf("\\n Enter 10 values of an array.....\\n"); for(i=0;i<10;i++) scanf("%d" (MORE)

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)

Write a program to arrange given set of number in ascending order using link lists in c language?

include <stdio.h> #include <conio.h> int main() { int a[10],i,j,temp=0; printf("Enter all the 10 numbers"); for(i=0;i<10;i++) scanf("%d",&a[i]); (MORE)