Home / C Programming / Functions :: Discussion

Discussion :: Functions

  1. What will be the output of the program?

     #include
     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);    
       }
     } 
    

     

  2. A.

    0, 2, 1, 0,

    B.

    1, 1, 2, 0,

    C.

    0, 1, 0, 2,

    D.

    0, 1, 2, 0,

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment