Loop help!
Hello everyone!
I was wondering if any of you could help me with fixing my code.
I want to be able to get the triangle to show 3 times next to each other, instead of one like below.
How can I do that?
Thank you!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include<iostream>
using namespace std;
int main(){
int num,i,j;
char separator;
cout<<"Enter number of lines: ";
cin>>num;
cout<<"Enter a character separator: ";
cin>>separator;
cout<<endl;
for(i=1;i <= num; i++)
{
for (j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
}
|
ypu mean, mean cout << "***"; ???
Last edited on
Topic archived. No new replies allowed.