501 views
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 Question

a) Compile time error
b) Undefined behaviour
c) 10 11
d) 10 Segmentation fault

 

1 Answer

Position:
Show:

Related questions

0 0 votes
0 0 answers
117
117 views
Palash 1 asked Apr 4
117 views
Sir, I can't access my gate CSE2027 test series and the problem is occuring when i click on attemt test after that site redirected to store/Test &Quizzes page to purchase...
3 3 votes
1 1 answer
289
289 views
goku4199 asked Jan 3
289 views
I have been on gateoverflow platform from a quite lot of time as an Editor I wanted to say something.......I have seen that a lot of answers people are writing completely...
0 0 votes
1 1 answer
468
468 views
shivamSK asked Jun 9, 2024
468 views
#include <stdio.h double pom(double x,int n){ if(n==1) return x; else return x*pom(x,n-1); n; } int main() { int a=pom(2,5); printf("%d",a); return 0; }what is the outpu...
1 1 vote
1 1 answer
395
395 views
shivamSK asked Jun 9, 2024
395 views
what is output of this c codeA: 321B: 123C: error(infinite/segmentation)D:333