Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pattern3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ using namespace std;
int main() {
int nRows;

label:
cout << "Enter number of rows you want to print: ";
cin >> nRows;
if (nRows < 0) {
while(nRows < 0){
cout << "Oops..Enter a positive number..!\n";
goto label;
cout << "Enter again: ";
cin >> nRows;
}

int nSpace=nRows-1;
Expand Down