C Programming - Functions - Discussion
Discussion Forum : Functions - Find Output of Program (Q.No. 5)
5.
What will be the output of the program?
#include<stdio.h>
void fun(int);
typedef int (*pf) (int, int);
int proc(pf, int, int);
int main()
{
int a=3;
fun(a);
return 0;
}
void fun(int n)
{
if(n > 0)
{
fun(--n);
printf("%d,", n);
fun(--n);
}
}
Discussion:
96 comments Page 7 of 10.
Tejashri said:
7 years ago
Hi, please explain this program in simple way.
Biru said:
9 years ago
Not able to understand it. Can anyone help me?
Hardik said:
6 years ago
@Raj.
Your explanation is the best. Thanks.
Your explanation is the best. Thanks.
(1)
Shahid said:
8 years ago
Output is wrong, it's a recursive function.
Fuad Al Masud said:
7 years ago
Can anyone explain the program in detail?
Guddi said:
7 years ago
I don't understand. Please explain to me.
Saurabh said:
1 decade ago
Thanks imran it really cleared my doubt.
Maggi said:
1 decade ago
Thank you rithesh. Good explanation. :).
Lakshmi said:
9 years ago
I can't understand. Please explain this.
R.K said:
9 years ago
@Sree.
Excellent explanation, Thankyou.
Excellent explanation, Thankyou.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers