answersLogoWhite

0


Best Answer

the following program will display all numbers given in the array in ascending order

#include<stdio.h>

void main()

{

int i,h,p;

int numbers[10]={5,8,3,2,6,7,9,4,1,10};

for(p=0;p<=8;p=p+1)

{

for(i=0;i<=8;i=i+1)

{

if(numbers[i]>numbers[i+1])

{

a=numbers[i];

numbers[i]=numbers[i+1];

numbers[i+1]=a;

}

}

}

for(i=0;i<=9;i=i+1)

{

printf("%d ",numbers[i]);

}

}

User Avatar

Wiki User

2010-11-28 18:31:20
This answer is:
User Avatar
Study guides
📓
See all Study Guides
✍️
Create a Study Guide
4.25
12 Reviews

Add your answer:

Earn +20 pts
Q: Write a program for which give number in ascending number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program which give given number in ascending order in c language?

what is c laungagee?????e


How can you write a c program to display numbers in ascending order in array?

I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


What is SAP give you the brief solution?

Write a program to convert a 2-digit BCD number into hexadecimal


Can you give me a program that will compute number 1 to 5?

nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.


What is 8.3 8.08 8.74 8.9 from least to greatest?

ascending order : 8.08,8.3,8.74,8.9 if u r confused in these type of questions..multiply a number say 10 or 100 or 1000 depending on the number of decimals in the numbers which in this case is 100.so the new numbers will be 830,808,874,890. arranging these above number in ascending order will give the ascending order of the original number always.


Write a program to implement domain and referential integrity?

give me the program which can related on domain and referential integrity.


When will be the BCA Ist year exam session 2009 of MU?

hello ...can u give me answer how to write program inheretance ... and types of inheretance ..... hello ...can u give me answer how to write program inheretance ... and types of inheretance .....


How do you create a free PC program?

You write a program just as if you intended to sell it for money, but instead you give it away free.


How do you write a c program to get a range from user and give a list of prime numbers?

To get all tutorials of "c programming" Reference:cprogramming-bd.com/c_page2.aspx# prime number


Give an example of pseudocode program?

psuedocode is a way of organizing a program before you write it. There isn't really a set standard for it. Instead of writing a program in C write it in english.if (the choice is equal to five){printf("output reponse to user");}Doing this helps you to understand what your code will do and where before you actually write the program


Write a program to calculate the area of a cylinder using a function?

give an example of calculation of mathematics

People also asked