0
How to reverse digits of a number in decending order and avoid repeated numbers without array?
5 Respostas
+ 1
you could use a string to loop over instead of an array,
int len = strlen( source );
for (i = 0; i < len; i++){
}
+ 1
lets change it this way, i almost asked incorrectly.
i need an app to get a number and generate a new number with the previous ones digits from the biggest to lowest , and also remove the digits which used once.
i.e : >> 29755 >> 9752
+ 1
Ali, do you have a code in progress, I just want to see to know how far you have gone through this, so no overlapping in steps. If there's a code please save in profile and attach its URL in the Description part of the original post.
And is there a restriction to what was allowed to use and not, apart from the array of course.
0
What do you mean by descending order? when you reverse a number's digits the position of digits are inverted, and why should you skip repetitive digits? and lastly, what if the number is Palindrome? e.g. 545.
0
very easy.. i usually use for loops and substring for this. so <string> is needed.