Is the way I used a while loop good style or should it be avoided?
Code:#include <iostream> using namespace std; int main(void){ int n; while(std::cout << "Enter the number of lines (e to quit): " && std::cin >> n){ for(int i = 0; i <= n; ++i){ for(int k = 0; k < n - i; ++k) std::cout << " "; for(int m = 1; m < i * 2; ++m) std::cout << "*"; std::cout << endl; } } return EXIT_SUCCESS; }



LinkBack URL
About LinkBacks


