Write a program that prints the arguments passed in the command line


Difficulty level
This exercise is mostly suitable for students
#include <stdio.h>

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

  printf("Number of arguments : %d\n", argc);
  for ( i=0; i<argc; i++ ) 
    printf("Argument %d : %s\n", i, argv[i]);
}

Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Implementation of a set using a long integer as bits