From 9ac7981fed8260be2df07d35651b6b79d6775d3c Mon Sep 17 00:00:00 2001 From: faizan Ahamed Date: Sun, 19 Apr 2020 20:39:06 +0530 Subject: [PATCH] Update stairs_pattern.cpp --- others/stairs_pattern.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/others/stairs_pattern.cpp b/others/stairs_pattern.cpp index e4fdba79f..c93782805 100644 --- a/others/stairs_pattern.cpp +++ b/others/stairs_pattern.cpp @@ -8,21 +8,20 @@ This program is use to print the following pattern ****** ******** ******** -where number of pairs line is given by user -*/ -#include -int main(){ +where number of pairs line is given by user */ +#include +int main() { int l, st = 2, x, r, z, n, sp; std::cout << "enter Index "; std::cin >> x; z = x; -for (r = 1; r <= x; r++){ +for (r = 1; r <= x; r++) { z = z - 1; -for (n = 1; n <= 2; n++){ -for (sp = 1; sp <= z; sp++){ +for (n = 1; n <= 2; n++) { +for (sp = 1; sp <= z; sp++) { std::cout << " "; } -for (l = 1; l <= st; l++){ +for (l = 1; l <= st; l++) { std::cout << "*"; } std::cout <<"\n";