C - Write program to use for loop to output command line parameter

Requirements

Write program to use for loop to output command line parameter

Hint

Loop from 0 till argc.

Demo

#include <stdio.h>

int main(int argc, char *argv[])
{
    int x;//  w  w  w  .java 2s  .  co m

    for(x=0;x<argc;x++)
        printf("Arg#%d = %s\n",x+1,argv[x]);
    return(0);
}

Result

Related Exercise