#include <iostream>


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

  std::cout << "Number of arguments: " << argc << std::endl;


  for (int i = 0; i < argc; i++) {

    std::cout << "Argument " << i << ": " << argv[i] << std::endl;

  }


  return 0;

}

output :

This program prints the number of arguments passed to it and the values of each argument.

To use this program, you can compile it and run it from the command line with some arguments. For example:

./program arg1 arg2 arg3

output : 

Number of arguments: 4
Argument 0: ./program
Argument 1: arg1
Argument 2: arg2
Argument 3: arg3