If the following program (myprog) is run from the command line as myprog monday tuesday wednesday thursday, What would be the output? main(int argc, char *argv[]) { while(--argc >0) printf("%s",*++argv); } a) myprog monday tuesday wednesday thursday b) monday tuesday wednesday thursday c) myprog tuesday thursday d) None of the above

This question is related to Sonata Interview

Showing Answers 1 - 1 of 1 Answers

shrutimitra

  • Oct 23rd, 2005
 

b) monday tuesday wednesday thursday. Because in while loop we have (--argc) which will ensure that the loop will run for 4 times. if we want to print value of (*++argv) ,it will skip the first value of argv array.

  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