4.22 LAB: Countdown until matching digits
Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer and stopping when both output digits are identical.
Note: End with a newline.
Ex: If the input is:
93
the output is:
92 91
Ex: If the input is:
10
the output is:
Ex: If the input is:
or any value not between 11 and 100 (inclusive), the output is:
Input must be between 11-100.
For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, 99), as that approach would be cumbersome for larger ranges.
4.22.1: LAB: Countdown until matching digits
main.cpp
Load default template.
#include <iostream>
using namespace std;
int main() {
// Type your code here
return 0;
}