Q. Comment on the output of following C code.

Code:
#include <stdio.h>
    main()
    {
        char *p = 0;
        *p = 'a';
        printf("value in pointer p is %c\n", *p);
    }
  • (A) It will print a
  • (B) It will print 0
  • (C) Compile time error
  • (D) Run time error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Run time error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
233
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yashika
Publisher
πŸ“ˆ
98%
Success Rate