Solution for Exercise 15-2

ex1502

#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("You typed %d arguments.\n",argc);
    return(0);
}

Output

You typed 1 arguments.

Notes

* The output (above) assumes that only the program name was typed at the command prompt. It's the first and only "argument."