Home / C Programming / Functions :: Discussion

Discussion :: Functions

  1. What will be the output of the program in 16 bit platform (Turbo C under DOS)?

     #include 
     
      int main() 
      {     
         int fun();  
         int i;    
         i = fun();    
         printf("%d\n", i);   
         return 0; 
     } 
     int fun()
     {     _
         AX = 1990;
     } 

     

  2. A.

    Garbage value

    B.

    0 (Zero)

    C.

    1990

    D.

    No output

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Turbo C (Windows): The return value of the function is taken from the Accumulator _AX=1990.

    But it may not work as expected in GCC compiler (Linux).


Be The First To Comment