From a3f8b9bc06fbdefbc8d2d9f568071ea6efaf0e07 Mon Sep 17 00:00:00 2001 From: Vipin Kumar Date: Sat, 28 Oct 2017 18:47:29 +0530 Subject: [PATCH] Update pattern3.cpp Removed goto statement. --- pattern3.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pattern3.cpp b/pattern3.cpp index 87c9102..992387d 100644 --- a/pattern3.cpp +++ b/pattern3.cpp @@ -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;