Answer to Question #103579 in C++ for shivani

Question #103579
The "signature" of a function is the first line which gives the return type, the name of the function and the parameters with their types. As an example the signature of the gcd function is

int gcd(int m, int n)

The function multiprint has the following signature.

void multiprint(char c, int n)

The function is required to print n copies of the character c. Write the function.
1
Expert's answer
2020-02-24T15:10:10-0500
#include <iostream>
using namespace std;


void multiprint(char c, int n)
{
	cout << string(n, c);
}

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