Write a function that will generate the following pattern using nested for loop.
+ . . . .
+ + . . .
+ + + . .
+ + + + .
#include <iostream>
using namespace std;
int main()
{
int plus=1;
for(int line=0; line < 3; line++)
{
for(int s=0; s < plus; s++)
cout << "+";
plus +=2;
cout << endl;
}
return(0);
}
#include <iostream>
using namespace std;
int main()
{
int plus = 1;
for(int line=0; line < 4; line++)
{
for(int s=0; s < plus; s++)
cout << "+";
plus+=1;
int dot=1;
for(int line=4; line > 0; line--)
for(int p=7; p < dot; p++);
cout << ".";
dot +=2;
cout << endl;
}
return(0);
}
i have improved the code to this put still confused as to how to increase the number of dots on each line. Bear in mind i am an amateur
cheers dean much appreciated