Question
So I have this C++ project that is supposed to diplay like this: I can't seem to get the bottom one to work. This is
So I have this C++ project that is supposed to diplay like this:
I can't seem to get the bottom one to work.
This is what I have so far
#include
#include
using namespace std;
void patternOne(int);
void patternTwo(int);
void patternThree(int);
int main() {
int numberOfRows = 5;
cout
patternOne(numberOfRows);
cout
patternTwo(numberOfRows);
cout
patternThree(numberOfRows);
return 0;
}
//patternOne function prototype
void patternOne(int rows) {
for (int row = 1; row
{
for (int count = 1; count
{
cout
}
cout
}
}
//patternTwo function prototype
void patternTwo(int rows) {
for (int row = rows; row >= 1; row--)
{
for (int count = row; count >= 1; count--)
{
cout
}
cout
}
}
//patternThree function prototype
void patternThree(int rows) {
for (int row = rows; row >= 1; rows--)
{
for (row = 0; row
{
cout
for (int count = row; count >= 1; count--)
{
cout
}
cout
}
}
}
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 Pattern 3 1 2 3 4 5 1 2 3 4 1 2 3 1 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started