Answer to Question #267177 in C++ for johnny

Question #267177

Make following patterns using loops. Do not hard code anything.

i)


|......|....................|

|......|.......***....*.....|

|......|......**....*.*.*...|

|......|.....**.....*...*...|

|......|......**............|

|......|........***.........|

|......|....................|


ii)

1

232

34543

4567654

567898765

4567654

34543

232

1


2 1234567654321

12345654321

123454321

1234321

12321

121

1


iii)

1 *

**

****

***********

*** ***

** **

* *


2

-.*

-.*-.*

-.*-.*-.*

-.*-.*-.*-.*

-.*-.*-.*-.*-.*


1
Expert's answer
2021-11-17T06:29:50-0500


SOLUTIO CODE


#include<iostream>
using namespace std;


int main() {


for(int i = 0; i< 5; i++)
{
	for(int j = 0; j<(i+1); j++)
	{
		cout<<"-.*";
	}
	cout<<endl;
}
   return 0;
}


SAMPLE OUTPUT



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
New on Blog
APPROVED BY CLIENTS