pointer-2

Pointers Output
Send Feedback

What will happen in this code?

int a = 100, b = 200;
int *p = &a, *q = &b; 

p = q;


Options
This problem may have one or more correct answers

q now points to a


What will be the output ?
Send Feedback
int a = 7;
int b = 17;
int *c = &b;
*c = 7; 

cout << a << " “ << b << endl;


Options
This problem may have one or more correct answers

17 17



What will be the output ?
Send Feedback
 int a = 50;
 int *ptr = &a;
 int *q = ptr;
 (*q)++; 

cout << a << endl;



Options
This problem may have one or more correct answers

None of these



What will be the output ?
Send Feedback
 int a = 50;
 int *ptr = &a;
 cout << (*ptr)++ << “ “; 

cout << a << endl;


Options
This problem may have one or more correct answers

50 50




What will be the output ?
Send Feedback
int *ptr = 0;
int a = 10;
*ptr = a; 

cout << *ptr << endl;


This problem may have one or more correct answers


 

Comments

Popular posts from this blog

Code : All connected components

Coding Ninjas