Home / C Programming / Command Line Arguments :: Discussion

Discussion :: Command Line Arguments

  1. What will be the output of the program (sample.c) given below if it is executed from the command line?
    cmd> sample "*.c"

      /* sample.c */
      #include 
    
      int main(int argc, int *argv) 
      {   
         int i;    
         for(i=1; i"%s\n", argv[i]); 
        return 0;
        }
    

  2. A.

    *.c

    B.

    "*.c"

    C.

    sample *.c

    D.

    List of all files and folders in the current directory

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment