Answer to Question #4286 in C++ for kuldeep

Question #4286
Write a program to produce following design by using "for" loop.
& & & & & & &
& & & & &
& & &
&
1
Expert's answer
2011-10-06T08:37:48-0400
#include <iostream>

using namespace std;

int main()
{
int i, j;

for (i=0; i<4; ++i)
{
for (j=0; j<i; ++j)
cout<<" ";
for (j=0; j<6-2*i; ++j)
cout<<"& ";
cout<<"&"<<endl;
}
system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS