Computer Science, asked by piiroplayer, 1 month ago

Write a program to print the following using a single loop( no nested loops) 3

1

11

111

1111

11111​

Answers

Answered by peeyush321kumar
0

for (i=1;i<=5;i++)

{

if (i==1)

cout<<"1\n";

else if(i==2)

cout<<"11\n"

else if(i==3)

cout<<"111\n"

else if(i==4)

cout<<"1111\n"

else if(i==5)

cout<<"11111\n"

}

}

Similar questions
Math, 8 months ago