Code:
for ( i = 1; i < argc; ++i )
argc contains the number of command-line arguments. So if you want to do something with each argument then create the loop as illustrated above. argc will always be at least 1 because the first argument is always the name of the program that is running.
Now if you want to actually use the value that was typed on the commnd-line you will have to convert it to an integer. There are other conversion functions, but atoi() will be sufficient as long as you don't enter some ridiculously huge number on the command line.
Code:
int x;
for ( i = 1; i < argc; ++i )
x = atoi(argv[i]);