0 votes
in Programming by (340 points)

4. Write a function MultiPrint(int n, char c) that prints n copies of character c. For example, if n=3 and c= 'a' then MultiPrint(int n, char c) prints 'aaa'.

(Answer will be given Next Week)

1 Answer

0 votes
by (340 points)

#include <stdio.h>

void Multiprint(int,char);

void main()

{

int n;

char c;

printf("What's the character?");

scanf("%c", &c);

printf("\n How many characters you want to print?");

scanf("%d"&n);

multiprint(n,c);

}

void multiPrint(int n, char c) {for (int i = 1; i <= n; i++)

void multiprint(int n, char c)

{

int i;

for(i=0;i<n;i++)

printf("%c", c);

}

Welcome to MAKAUT Community, where you can ask questions and receive answers from other members of the community.
...