home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
98.img
/
LCNOW2.ZIP
/
EXAMPLES
/
REPEAT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-25
|
406b
|
26 lines
/*
* R E P E A T
*
* Ask the user for a character and a count. Display the
* character the number of times specified by count.
*/
main()
{
char ch;
int count;
printf("Type the character to repeat: ");
scanf("%1s", &ch);
printf("Type the repetition count: ");
scanf("%d", &count);
while (count > 0) {
printf("%c", ch);
--count;
}
printf("\n");
return (0);
}