Question: c++ 1. Write a program called a05part2.cpp that reads an integer from the user and uses while loops to output the number of odd digits
1. Write a program called a05part2.cpp that reads an integer from the user and uses while loops to output the number of odd digits and even digits in that integer. For example, if the user enters 2536, your program should output 2 even digits and 2 odd digits. If the user enters 1298763, your program should output 3 even digits and 4 odd digits. Hint: Use the % and / by 10 to break the integer into individual digits. Then use % to check if the number is even or odd
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
