- 2
Take a 4 digit no. Write program to display a no. whose digits are 2 greater than the corresponding digits of the no.ex.123 246.
4 Antworten
+ 2
i think he meant to say that you need 4 numbers as input and then sort them according to the condition
+ 1
Probably 567 -> 024
How are those 4 digit numbers anyway?
0
What if a digit is 9? Does it become 1 or 11? Asking because 11 is not a digit, but a number.
edit:
Now you added an example. The described requirements don't match the example though.
"Take a 4 digit no. Write program to display a no. whose digits are the doubled corresponding digits of the no.ex.123 246."
But it's still not clear how to handle digits which result will be higher than 9. Give an example for "567" pls ^^