Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
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 10 20 30 /* myprog.c */ #include
int main(int argc, char **argv) { int i; for(i=0; i
10 20 30
myprog 10 20
myprog 10 20 30
10 20
Correct Answer:
myprog 10 20 30
← Previous Question
Next Question→
More Questions from
Command Line Arguments
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 (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("%s ", _argv[i]); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments