diff --git a/pattern1.cpp b/pattern1.cpp index 2f7d129..c4f9bdb 100644 --- a/pattern1.cpp +++ b/pattern1.cpp @@ -9,18 +9,20 @@ using namespace std; int main() { + int nRows; label: cout << "Enter number of rows you want to print: "; cin >> nRows; + if (nRows < 0) { cout << "Oops..Enter a positive number..!\n"; goto label; } - for (int i=1; i<=nRows; i++) { - for (int j=1; j<=i; j++) { + for (int i=0; i