[prev] [index] [next]

Exercise: Integers between N and M

Consider the program to print the first 10 integers.

Modify it so that can ...

  • print all integers between M and N
  • accept M and N as a command-line argument
  • complain if M or N isn't an integer

Use sscanf() to create an integer from a string. Example:

int n;
sscanf(argv[1], "%d", &n);