0
Problem to get following output
* * * using for loop
3 Respuestas
+ 1
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<=3;i++){
for(int j=1;j<=3;j++){
if(j==i){
cout<<"*";
continue;
}
cout<<" ";
}
cout<<endl;
}
}
+ 1
#include <iostream>
using namespace std;
int main() {
int i,n;
for(i=0;i<3;i++)
{
for(n=1;n<2;n++)
{
cout << "*";
}
cout << "\n";
for(;n<i+3;n++)
cout << " ";
}
return 0;
}
0
Thanks