Command Line Arguments

Q1: What will be the output of the program if it is executed like below?
cmd> sample
/* sample.c */
#include<stdio.h>

int main(int argc, char **argv)
{
    printf('%s\n', argv[argc-1]);
    return 0;
}

A 0

B sample

C samp

D No output

ANS:A - 0

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.