#include <stdio.h>#include <stdlib.h>int main(int argc, char **argv) { int i, parameter = 0; if (argc >= 2) { /* there is 1 parameter (or more) in the command line used */ /* argv[0] may point to the program name */ /* argv[1] points to the 1st parameter */ /* argv[argc] is NULL */ parameter = atoi(argv[1]); /* better to use strtol */ if (parameter > 0) { for (i = 0; i < parameter; i++) printf("%d ", i); } else { fprintf(stderr, "Please use a positive integer.\n"); } } return 0;}