#include using namespace std; int main() { cout << "Please input an even number in range [4,30]: "; int number; cin >> number; while ( number < 4 || number > 30 || number % 2 != 0 ) { cout << "Invalid. Please try again: "; cin >> number; } int spaces = 20; for ( int c = 2 ; c <= number ; c += 2 ) { // display the initial spaces: for ( int s = 0 ; s < spaces ; s++ ) { cout << ' '; } // display the asterisk characters: for ( int i = 0 ; i < c ; i++ ) { cout << '*'; } cout << endl; spaces--; } return 0; }