Q. What is the output of C Program with pointers?

Code:
int main()
{
    int a=10;
    int *p, **q;
    p=&a;
    q=&p;
    printf("%d ", a);
    *p=15;
    printf("%d ", a);
    **q=20;
    printf("%d ", a);
    return 0;
}
  • (A) 10 10 10
  • (B) 10 0 0
  • (C) 10 15 20
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 10 15 20

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
221
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
86%
Success Rate