0 0 votes #include <stdio.h> void f(int (*x)(int)); int myfoo(int i); int (*foo)(int) = myfoo; int main() { f(foo(10)); } void f(int (*i)(int)) { i(11); } int myfoo(int i) { printf("%d\n", i); return i; }sanfoundry C programming Questiona) Compile time errorb) Undefined behaviourc) 10 11d) 10 Segmentation fault Programming in C programming-in-c programming gateoverflow + – shivamSK 501 views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Shaik Masthan commented Jun 19, 2024 reply Follow flag f(foo(10)) -- foo(10) executed and return int. Therefore it is like f(10) -- f(int) --- parameter mismatch. It will assume 10 as memory address instead of int. 1 1 replyShare shivamSK commented Jun 19, 2024 reply Follow flag d) 10 Segmentation fault 1 1 replyShare Please log in or register to add a comment.
0 0 votes answer is 10 and number of times i am here printed D is correct shivamSK answered Jun 20, 2024 shivamSK comment Share Follow 0 reply Please log in or register to add a comment.