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 Jan Feb Mar

    /* sample.c */
     #include
     #include  
    
     int main(int arc, char *arv[])
     {   
        int i;   
        for(i=1; i<_argc i printf class="string">"%s ", _argv[i]);
        return 0;
     } 
    

  2. A.

    No output

    B.

    sample Jan Feb Mar

    C.

    Jan Feb Mar

    D.

    Error

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment