+ 1
To print the pattern
* * * * * * * * * * *
7 Answers
+ 3
#include <iostream>
using namespace std;
int main() {
cout << " *\n";
cout << " * *\n";
cout << " * *\n";
cout << "********\n";
}
+ 3
test on play ground.
+ 3
#include <iostream>
using namespace std;
int main() {
for (int i = 1; i <= 4; ++i)
{
switch(i)
{
case 1:
cout << " *\n";
break;
case 2:
cout << " * *\n";
break;
case 3:
cout << " * *\n";
break;
case 4:
cout << "* * * * *\n";
break;
}
}
}
0
this is not the proper one
0
this is not the proper way
0
any one can print by this method
0
print it by using nesting