0

Problem to get following output

* * * using for loop

5th Nov 2016, 4:57 AM
Aditya
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; } }
5th Nov 2016, 5:23 AM
kamal joshi
kamal joshi - avatar
+ 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; }
5th Nov 2016, 5:33 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
Thanks
5th Nov 2016, 5:25 AM
Aditya