C Programming - Command Line Arguments - Discussion

Discussion Forum : Command Line Arguments - Find Output of Program (Q.No. 5)
5.
What will be the output of the program
#include<stdio.h>
void fun(int);

int main(int argc)
{
    printf("%d ", argc);
    fun(argc);
    return 0;
}
void fun(int i)
{
    if(i!=4)
        main(++i);
}
1 2 3
1 2 3 4
2 3 4
1
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
28 comments Page 3 of 3.

Divya said:   1 decade ago
Thanks sreepal:) very nice explanation

Moshii said:   1 decade ago
Thanks sreepal for your great ans.

Sravya said:   7 years ago
Good explanation @Shalini.

Sravan said:   1 decade ago
It is a nice explanation.

Subhashini said:   6 years ago
Thank you @Rohan.

Anil kumar said:   1 decade ago
Thanks sreepal.

Jhunu said:   1 decade ago
Thanks sreepal.

Pratik said:   9 years ago
Why argc is 1?


Post your comments here:

Your comments will be displayed after verification.