This simple C program shows the method to accept and display command-line arguments.
#include <stdio.h>
int main(int argc, char *argv[])
{
int x;
// using for loop to iterate all the character...
for(x = 1; x < argc; x++)
printf("%s%s", argv[x],(x<argc-1) ? " ": "");
// go to a new line...
printf("\n");
return 0;
}