+ 1
How to print this pattern?
* *** ***** ******* *********
4 Respuestas
+ 4
#include <iostream>
using namespace std;
int main() {
int a = 16;
int k;
for(int i = 1; i < 2 * a; i+= 2){
for(k = 0;k < a - i / 2; k++)
cout << ' ';
for(k = 0; k < i; k++)
cout << "*";
cout << endl;
}
return 0;
}
+ 3
This code may help you
https://code.sololearn.com/c539Y9zyhxh7/?ref=app
+ 1
An way is:
from 1 to 9 by step 2 as N
print (N/2)-times 'space'
print N-times '*'
print (N/2)-times 'space'