C Programming - Functions - Discussion

Discussion Forum : Functions - Find Output of Program (Q.No. 10)
10.
What will be the output of the program?
#include<stdio.h>
int fun(int, int);
typedef int (*pf) (int, int);
int proc(pf, int, int);

int main()
{
    printf("%d\n", proc(fun, 6, 6));
    return 0;
}
int fun(int a, int b)
{
   return (a==b);
}
int proc(pf p, int a, int b)
{
   return ((*p)(a, b));
}
6
1
0
-1
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
49 comments Page 5 of 5.

Bagesh Kumar singh said:   1 decade ago
Any one explain me!

XYZ said:   1 decade ago
How this happened?

Ashok said:   1 decade ago
Thank you vishwas.

Suraj said:   6 years ago
Thanks @Vishwas.

Raj said:   3 years ago
Thanks @Vishwas.
(1)

Rita said:   1 decade ago
Thanks aashish.

Nagaraj said:   1 decade ago
Thanks vishwas.

Preethi said:   2 decades ago
Thanks Sundar.

Zahed said:   7 years ago
Thanks all.


Post your comments here:

Your comments will be displayed after verification.