Previous Next
0 / 18
Module DEMO-32-90DEMO-C-32

Character Repeater

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a function void printRepeat(char c, int n) that prints the character c exactly n times followed by a newline.

Constraints

n >= 0.

Input Format

A character and an integer.

Output Format

The character repeated n times.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
* 5
*****
repeated 5 times.
Sample #2
Public sample
A 1
A
Once.
Sample #3
Public sample
- 10
----------
Dash 10 times.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings