Write a program to print the following using a single loop( no nested loops) 3
1
11
111
1111
11111
Answers
Answered by
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,
29 days ago
English,
29 days ago
Environmental Sciences,
1 month ago
Social Sciences,
1 month ago
Math,
8 months ago