/* * print arguments followed by a newline */ #include int main(int argc, char *argv[]) { int i; /* counter in a for loop */ /* * go through the argument list, skipping arg 0 (it's * the program name) */ for(i = 1; i < argc-1; i++) printf("%s ", argv[i]); /* * now print the last argument, UNLESS it is arg 0 */ if (argc > 1) printf("%s\n", argv[argc-1]); /* * return success! */ return(0); }