stairs_pattern.cpp File Reference

This program is use to print the following pattern. More...

`#include <iostream>`
Include dependency graph for stairs_pattern.cpp:

## Functions

int | main ()

## Detailed Description

This program is use to print the following pattern.

       \*\*
       \*\*
      \*\*\*\*
      \*\*\*\*
     \*\*\*\*\*\*
     \*\*\*\*\*\*
    \*\*\*\*\*\*\*\*

where number of pairs line is given by user

## Function Documentation

## main()

int main | ( | void |  | ) |

main function

{
int l, st = 2, x, r, z, n, sp;
std::cout << "enter Index ";
std::cin >> x;
z = x;
for (r = 1; r <= x; r++) {
z = z - 1;
for (n = 1; n <= 2; n++) {
for (sp = 1; sp <= z; sp++) {
std::cout << " ";
}
for (l = 1; l <= st; l++) {
std::cout << "*";
}
std::cout << std::endl;
}
st = st + 2;
}
}
std::cin
std::cout
std::endl
T endl(T... args)
Here is the call graph for this function: