0
please help me sort this in c++ program
the program is to print the following output using c++ this is a symbol of asterisk--- * * * * * *
1 Réponse
+ 1
#include <iostream>
using namespace std;
int main() {
for(int i=1;i<=3;i++)
{
for(int j=1;j<=3-i;j++)
cout<<" ";
for(int k=1;k<2*i;k++)
{
if(k%2==1)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
return 0;
}