1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <stdio.h> #include <string.h> int main(int argc, const char *argv[]) { char message[20]; int count, i; strcpy(message, "Hello, world!"); printf("Repeat how many times?"); scanf("%d", &count); for (i = 0; i < count; i++) { printf("%3d - %s\n", i, message); } return 0; }