adplus-dvertising
frame-decoration

Question

What will be output for the following code?
#include <stdio.h>
int main(int argc, char *argv[])
{
    printf(""%s
"", argv[-1]);
    return 0;
}

a.

./a.out

b.

Segmentation fault/code crash

c.

-1

d.

Depends on the compiler

Posted under C Programming

Answer: (b).Segmentation fault/code crash

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be output for the following code?