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. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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.

22nd Feb 2018, 1:49 PM
Vikram Vm
Vikram Vm - avatar
4 Answers
+ 2
i think he meant to say that you need 4 numbers as input and then sort them according to the condition
22nd Feb 2018, 2:47 PM
‎ ‏‏‎Anonymous Guy
+ 1
Probably 567 -> 024 How are those 4 digit numbers anyway?
22nd Feb 2018, 2:21 PM
David Handl
David Handl - avatar
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 ^^
22nd Feb 2018, 1:53 PM
Alex
Alex - avatar