0
Hiš¤š¤ how can make this figure by using loop
******** ******** ******** ********
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;
}
+ 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;
}
0
thank you šš