C Programming - Command Line Arguments - Discussion

Discussion Forum : Command Line Arguments - Find Output of Program (Q.No. 7)
7.
What will be the output of the program if it is executed like below?
cmd> sample
/* sample.c */
#include<stdio.h>

int main(int argc, char **argv)
{
    printf("%s\n", argv[argc-1]);
    return 0;
}
0
sample
samp
No output
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
15 comments Page 2 of 2.

Akash said:   8 years ago
Thank you so much @Pallavi.

Raksha said:   1 decade ago
thanks pallav.........

Reegan Kothari said:   1 decade ago
thanks pallavi.....

Gandhi said:   1 decade ago
thanks himadri

Handyrockzz said:   1 decade ago
tanks pallvi


Post your comments here:

Your comments will be displayed after verification.