C Programming - Command Line Arguments - Discussion
Discussion Forum : Command Line Arguments - Find Output of Program (Q.No. 14)
14.
If the following program (myproc.c) is present in the directory "C:\TC" then what will be output of the program if run it from DOS shell?
/* myproc.c */
#include<stdio.h>
int main(int argc, char *argv[])
{
printf("%s", argv[0]);
return 0;
}
Answer: Option
Explanation:
In order to execute it from DOS shell, we have to run the created EXE file by entering the exe file name as C:\TC>myproc <enter>.
Discussion:
2 comments Page 1 of 1.
Ankush said:
1 decade ago
OK so you're saying that this string "C:\TC>myproc" will be copied into the argument and then it'll be on the CMD screen when actual program executes? Right?
S.p said:
3 years ago
Here copy destination to source and print a new value after execute.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers