C Programming :: Command Line Arguments
-
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three/* myprog.c */ #include
-
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three/* myprog.c */ #include
#include int main(int argc, char **argv) { printf("%s\n", *++argv); return 0; } -
What will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)?
cmd> sample 1 2 3/* sample.c */ #include
int main(int argc, char *argv[]) { int j; j = argv[1] + argv[2] + argv[3]; printf("%d", j); return 0; } -
What will be the output of the program (sample.c) given below if it is executed from the command line (turbo c under DOS)?
cmd> sample Good Morning/* sample.c */ #include
int main(int argc, char *argv[]) { printf("%d %s", argc, argv[1]); return 0; } -
What will be the output of the program
#include
-
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample friday tuesday sunday/* sample.c */ #include
int main(int argc, char *argv[]) { printf("%c", **++argv); return 0; } -
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog friday tuesday sunday/* myprog.c */ #include
int main(int argc, char *argv[]) { printf("%c", *++argv[1]); return 0; } -
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample one two three/* sample.c */ #include
int main(int argc, char *argv[]) { int i=0; i+=strlen(argv[1]); while(i>0) { printf("%c", argv[1][--i]); } return 0; } -
What will be the output of the program in Turbo C?
#include
"%s\n", env[i]); return 0; } -
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
int main(int arc, char *arv[]) { int i; for(i=1; i<_argc i printf class="string">"%s ", _argv[i]); return 0; }