ExamVeda
Login
Home
This question belongs to C Program Pointer
Pointer
?

What will be the output?
main() 
{ 
      char *p; 
      p = "Hello"; 
      printf("%cn",*&*p); 
}

Answer & Solution
Correct Answer: Option B

* is a dereference operator & is a reference operator. They can be applied any number of times provided it is meaningful. Here p points to the first character in the string "Hello". *p dereferences it and so its value is H. Again & references it to an address and * dereferences it to the value H.

Examveda
Question posted by Examveda
Community

Join the Discussion

2 Comments
Satendra Chauhan
Satendra Chauhan 9 years ago
%cn .when n don't consider answer is a
'b'.
Amitkumar Pramanik
Amitkumar Pramanik 9 years ago
Answer should be Hn so d option should be correct