logo

CuriousTab

CuriousTab

Command Line Arguments problems


  • 1. What will be the output of the program (sample.c) given below if it is executed from the command line?
    cmd> sample Jan Feb Mar
    /* sample.c */
    #include<stdio.h>
    #include<dos.h>
    
    int main(int arc, char *arv[])
    {
        int i;
        for(i=1; i<_argc; i++)
            printf("%s ", _argv[i]);
        return 0;
    }
    

  • Options
  • A. No output
  • B. sample Jan Feb Mar
  • C. Jan Feb Mar
  • D. Error
  • Discuss

First 2 3