C Programming - Functions - Discussion
Discussion Forum : Functions - Find Output of Program (Q.No. 20)
20.
What will be the output of the program?
#include<stdio.h>
int fun(int);
int main()
{
float k=3;
fun(k=fun(fun(k)));
printf("%f\n", k);
return 0;
}
int fun(int i)
{
i++;
return i;
}
Discussion:
21 comments Page 3 of 3.
Shivani said:
5 years ago
Here is fun( k=fun(fun)).
So, k = 2 times increment ie 5.
It will be 6 if k=fun(fun(fun))).
So, k = 2 times increment ie 5.
It will be 6 if k=fun(fun(fun))).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers