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);
}
Comments
Leave a comment