Top

Discussion

What will be the output of the following C code?

int main () 
{ 
   printf("starting of program\n"); 
   printf("program exits\n"); 
   exit(0);  
   printf("program ends\n");  
   return(0); 
}

 

  • A.
    starting of program
    program exits
    program ends
  • B.
    starting of program
    program exits
  • C.
    starting of program
    program ends
  • D.error

Answer: B

void exit(int status) function is used to terminate the calling process immediately.

No comment is present. Be the first to comment.
Loading…

Post your comment