answersLogoWhite

0

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

14y ago

What else can I help you with?

Related Questions

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


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

give an example of calculation of mathematics


Write a program in FORTRAN C language to compute control ratios used in budgeting with reference to any organization?

if u give control ratios used in budgeting i can write program in C/C++


Write in BlueJ to print lucky numbers?

To print lucky numbers in java, you must give the following program: class example { static public void main(String[] args) { System.out.println("Lucky number is your favourite number which is your DOB"); } }


How do you give Jake T Austin your number?

write to him on his fan mail