3 Questions
Increase even digit by 1 and decrease odd digit by 1 of an integer number
algorithm
4058396 (4+1)=5, (0+1)=1, (5-1)=4, (8+1)=9, (3-1)=2, (9-1)=8, (6+1)=7
example
N = 4058396
input
Test your C++ skills by writing a program that modifies the digits of an integer according to specific rules. In this case, the program should increase even digits by 1 and decrease odd digits by 1.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free