Answers for "how to make full pyramid in c++ using string"

C++
0

print pattern and space in cpp

//WAP to print triangle pattern... LOGIC
int num{}, i{1};
  cin >> num;
  while (i <= num) {
    for (int space = 1; space <= (num - i); space++) {  // space
      cout << " ";
    }
    for (int value = 1; value <= (2 * i - 1); value++) {  // value
      cout << value;
    }
    cout << endl; //next row
    i++;
  }
Posted by: Guest on September-30-2020

Code answers related to "how to make full pyramid in c++ using string"

Browse Popular Code Answers by Language