summaryrefslogtreecommitdiff
path: root/convert.c
blob: df36365a62c3ce15dc839b6065785dfbb2c08a85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>

void usage(const char *program_name)
{
  printf("Usage: %s <message> <# of times to repeat>\n", program_name);
  exit(1);
}

int main(int argc, const char *argv[])
{
  int i, count;

  if (argc < 3)
    usage(argv[0]);

  count = atoi(argv[2]);
  printf("Repeating %d times..\n", count);

  for (i = 0; i < count; i++) {
    printf("%3d - %s\n", i, argv[1]);
  }
  return 0;
}