PDA

View Full Version : how can i do this (nested loopsss...............................)



yashu18
13th June 2015, 09:15
//THIS IS MY CODE FOR THAT PLS HELP









#include <iostream>
using namespace std;
int main()
{
int i,j,k;
for(i=1;i<2;++i)
{
for(k=1;k<5;k++)
cout<<" ";
for(j=1;j<9;j++)
cout<<"*";
cout<<endl;
}
for(i=1;i<=7;++i)
{
for(k=1;k<12;++k)
cout<<" ";
for(j=1;j<=1;++j)
cout<<"*";
cout<<endl;
}
for(i=1;i<=4;++i){

for(k=1;k<5;++k)
cout<<" ";
if((i==1||i==4))
{
for(j=1;j<8;++j)
cout<<"*";
}

else{ cout<<"*";
}
cout<<endl;
}

cout<<endl;




return 0;
}

11206

jefftee
14th June 2015, 03:28
Please repost your code with the
tags with proper indentation. You might also want to state what you're trying to achieve and where you are having a problem.