123456789101112131415161718192021
#include <iostream> #include "_pause.h" using namespace std; int main(){ int num; cout << "Enter a number from 10 to 99: "; cin >> num; if(num > 9 && num < 100){ cout << num; } cout << endl; std::cin.get(); _pause(); return EXIT_SUCCESS; }
12345
if( num > 9 && num < 100 ) { // if it is a positive two digit number std::cout << num/10 /* first digit eg. 78/10 == 7 */ << ' ' /* space */ << num%10 /* second digit eg. 78%10 == 8 */ << '\n' /* new line */ ; }