Home » C Programming » Command Line Arguments » Question
  1. What will be the output of the following C code (run without any command line arguments)?
    #include <stdio.h>
    int main(int argc, char *argv[])
    {
    while (*argv++ != NULL)
    printf("%s\n", *argv);
    return 0;
    }
    1. Depends on compiler
    2. Segmentation fault/code crash
    3. Executable file name
    4. Nothing
    5. None of these
Correct Option: B

Segmentation fault/code crash



Your comments will be displayed only after manual approval.