MCQ Practice Single Best Answer Topic: Pointer in C Language

Q What will be the output of the following program?
#include"stdio.h" 
char *fun(){
  char *temp = "atnyla";
  return temp; 
}
void main()
{
puts(fun());
}
 

Question ID
#1275
Subchapter
Pointer in C Language
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A atnyla
  • B Null Pointer Exception
  • C Compiler error
  • D Unexpected results due to dangling pointers
Correct Answer: A

Explanation

atnyla

Share This Question

Share this MCQ with your friends or study group.