Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 2. Repeat the character
- Make program that will get one character (CH) and number (N) from input.
- Print the character N times to output.
- Character can be any character from ASCII table with number higher than 32 and smaller than 127
- 0 <= N <= 100
- */
- #include <stdio.h>
- int main (void){
- char character;
- int num, i;
- printf("Enter the character: ");
- scanf("%c", &character);
- printf("Enter the number: ");
- scanf("%d", &num);
- for (i = 0 ; i < num ; i++ ){
- printf("%c", character);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement