answersLogoWhite

0

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

Updated: 8/16/2019
User Avatar

Venturert

Lvl 1
15y ago

Best Answer

#include <stdio.h>

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");

for(i=1;i<=n;i++)

scanf("%d",&a[i]);

for(j=1;j<=n-i;j++)

scanf("%d",&[j+1])

{

t=a[j];

a[j]=a[j+1]=t;

}

printf("the numbers after sorting are:\n");

for(i=1;i<=n;i++)

printf("%d\t",a[i]);

getch();

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program in C to ascend n numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a program in objective c numbers 1-100 prime numbers?

fdsgfhgdfhgdf


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


Write a C Program to print sum of squares of odd numbers?

#include


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


Write a 'c' program to fine a largest of three numbers?

largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c


Write a programme for substraction of two numbers in c language?

substracion of any two number program in c


Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Write a C program to find the sum of all prime numbers?

Since there is an infinite set of prime numbers the answer would be infinity.


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


How do you write a c program sum of ODD Numbers in the Given Range?

Reference: cprogramming-bd.com/c_page4.aspx#ODD%20 Numbers