WAP to input a number and print it's digits in ascending order
Answers
Answered by
2
Given an array of numbers, the task is to print those numbers in ascending order separated by commas which have 1, 2 and 3 in their digits. If no number containing digits 1, 2, and 3 present then print -1.
Examples:-
Input : numbers[] = {123, 1232, 456, 234, 32145}
Output : 123, 1232, 32145
Input : numbers[] = {9821, 627183, 12, 1234}
Output : 1234, 627183
Input : numbers[] = {12, 232, 456, 234}
Output : -1
Similar questions