60 428
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #15435 in C++ for zyrus

Question #15435
Write a C++ program that would display the following output:

0123456789 1 * 1 2 3 4 5
0123456789 2 * * 1 2 3 4
0123456789 3 * * * 1 2 3
0123456789 4 * * * * 1 2
0123456789 5 * * * * * 1
Expert's answer
#include <iostream>
using namespace std;
void f(int a){
& int i,j,k;
& for(i=0;i<10;i++)
& cout<<i;

& cout<<" quot;<<a;
& cout<<"\t";
& for(i=0;i<a;i++)
& cout<<"*";
& cout<<"\t";
& for(i=1;i<7-a;i++)
& cout<<i<<"& ";
& cout<<i<<"\n";
& }

int main()
{
for(int i=1;i<6;i++)
f(i);


cin.get();
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions