Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
Loading...
Searching...
No Matches
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

17 {
18 int l, st = 2, x, r, z, n, sp;
19 std::cout << "Enter number of pair - ";
20 std::cin >> x;
21 z = x;
22 for (r = 1; r <= x; r++) {
23 z = z - 1;
24 for (n = 1; n <= 2; n++) {
25 for (sp = 1; sp <= z; sp++) {
26 std::cout << " ";
27 }
28 for (l = 1; l <= st; l++) {
29 std::cout << "\\*";
30 }
32 }
33 st = st + 2;
34 }
35}
double l(double x)
Another test function.
Definition composite_simpson_rule.cpp:119
T endl(T... args)
Here is the call graph for this function: