Computer Science, asked by muskanjain2510, 6 months ago

wap to take a 5 digit no as input then store all its digit in array and display those digits in descending order

Answers

Answered by vivek7618
0

Explanation:

num = 4562

rev_num = 0

rev_num = rev_num *10 + num%10 = 2

num = num/10 = 456

rev_num = rev_num *10 + num%10 = 20 + 6 = 26

num = num/10 = 45

rev_num = rev_num *10 + num%10 = 260 + 5 = 265

num = num/10 = 4

rev_num = rev_num *10 + num%10 = 265 + 4 = 2654

num = num/10 = 0

Similar questions