If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output? main(int argc, char *argv[]) {    int i;    for(i=0;i<argc;i++)    printf("%s",argv[i]); }

A) 1 2 3
B) C:MYPROG.EXE123
C) MYP
D) None of the above

Showing Answers 1 - 11 of 11 Answers

mukul sharma

  • Mar 21st, 2006
 

right answer is B:because argv is char string which store command line as input and argc is int counter which give the length of this string.

  Was this answer useful?  Yes

yrenster

  • Feb 5th, 2008
 

None of the above. It should be : myprog123. Because argv[0]="myprog", argv[1]="1", argv[2]="2", argv[3]="3".

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions