C Programming - Command Line Arguments - Discussion
Discussion Forum : Command Line Arguments - Find Output of Program (Q.No. 18)
18.
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
cmd> sample friday tuesday sunday
/* sample.c */
#include<stdio.h>
int main(int sizeofargv, char *argv[])
{
while(sizeofargv)
printf("%s", argv[--sizeofargv]);
return 0;
}
Discussion:
11 comments Page 2 of 2.
Mani said:
1 decade ago
Thanks Arvind.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers