answersLogoWhite

0


Best Answer

decimal[] a = new decimal[20];

// initialize to some numbers

for (int i = 0; i < 20; i++)

{

a[i] = i;

}

Array.Sort(a); //sorted in increasing order

Array.Reverse(a); // decreasing

foreach (decimal d in a)

{

Console.WriteLine(d);

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to sort 20 decimal numbers in decreasing order and print the result?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the relationship between decimal products and quotients?

Decimal products are numbers that are the result of multiplication procedures and are not whole numbers. Decimal quotients are numbers that are the result of division procedures and are not whole numbers.


What is the result of using a decimal tab stop?

A decimal tab stop is wonderful for numbers that are followed by decimal points. For example, when working with a number like 1,345.280, it uses the decimal point for the tab position. The numbers 1,345 space to the right of the tab, the decimal is exactly on the tab mark, and the numbers 280 fall to the right of the tab. Your numbers will look like this: 1,345.280 2,911.75 4,464.2257 8,721.2557 See how the decimal always stays in the center? That's how a decimal tab works.


What decimal is halfway between 4.5 and 4.6?

Add the two numbers, and divide the result by 2.


How do you multiply 471.5 with 21.3?

The same way you multiply any other decimal numbers. The result is 10,042.95.


When adding decimal numbers which number do you start with?

Addition is commutative which means the order doesn't matter, the result will be the same.


What two numbers multiplied gives you 29?

There is an infinite combination of numbers you can use to multiply that will result in 29. However, no whole numbers can be multiplied to result in 29. Instead, multiply a fraction or decimal. For example: 2 and 14.5 or 14 1/2.


How do you find rational numbers between two irrational numbers?

An irrational number is expressed as a non-repeating decimal that goes on forever. Write out the enough of the decimal expansion of each number to find the first digit where the two numbers disagree. Truncate the larger number at that digit, and the result is a rational number (terminating decimal) that is between the two.


Are decimals related to ratios?

Yes,decimal are related to ratios in mathematics. When a ratio is solved or two numbers are not divisible by each other then the result of the division of the ratio is decimal number only.


Is any report that earth rotation speed decreasing?

Earth's rotation speed is gradually decreasing, as a result of the tides.


Can the final product of two numbers to contain fewer decimal places than either of the numbers being multiplied?

Only if the result is a string of zeroes. 0.25 * 0.40 = 0.1 &#9632;


1 To develop a program using the ADI instruction to add the two hexadecimal numbers 3AH and 48H and store the result in memory location 2100H?

Write a program using the ADI instruction to add the two hexadecimal numbers 3AH and 48H and store the result in memory location 2100H


How do you find 1017.87 to 1 decimal place?

It is 1017.9The two numbers, rounded to 1 decimal place on either side of 1017.87 are 1017.8 and 1017.9 Of these the latter is closer and so the result.