πŸ“Š C Programming
Q. What is the output of C Program with pointers?
Code:
int main()
{
    int a=20;
    int *p, *q;
    p=&a;
    q=p;
    printf("%d ", a);
    *p=30;
    printf("%d ", a);
    *q=40;
    printf("%d ", a);
    return 0;
}
  • (A) 20 0 0
  • (B) 20 20 20
  • (C) 20 30 40
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 20 30 40

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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