R

Ram Sharma • 193.86K Points
Coach

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

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics