Write the code to sort and output them in decending order integer array(5) temps integer i integer k integer tmp for k = 0; k temps[i] tmp = temps[k] temps[k] = temps[i] temps[i] = tmp Put "temps...





Write the code to sort and output them in decending order



integer array(5) temps


integer i


integer k


integer tmp


for k = 0; k<5; k="k" +="">


temps[k] = -1000


for i = 0; i < 5;="" i="i" +="">


temps[i] = Get next input


for k = 0; k < i;="" k="k" +="">


if temps[k] > temps[i]


tmp = temps[k]


temps[k] = temps[i]


temps[i] = tmp


Put "temps input are: \n" to output


for i = 0; i < 5;="" i="i" +="">


Put temps[i] to output


Put " " to output Put "\n" to output



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here