Hi🤗🤗 how can make this figure by using loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi🤗🤗 how can make this figure by using loop

******** ******** ******** ********

15th Jun 2017, 8:13 AM
Bts...
Bts... - avatar
3 Answers
+ 17
#include <iostream> using namespace std; int main() { for (int stp = 0; stp <= 4; stp++) { if (stp%2==0) { cout<<"********"<<endl; } else { cout<<" ********"<<endl; } } return 0; }
15th Jun 2017, 8:16 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 7
// just adding another sample #include <iostream> using namespace std; int main() { for (int stp = 0; stp < 4; stp++) { if (stp%2!=0) cout << " "; cout<<"********"<<endl; } } return 0; }
15th Jun 2017, 9:51 AM
Hatsy Rei
Hatsy Rei - avatar
0
thank you 😉😉
15th Jun 2017, 8:27 AM
Bts...
Bts... - avatar