What is value ofmyInt?
#include <iostream>
using namespace std;
int main() {
int myInt;
int* myScore;
int myVar;
myInt = 10;
myScore = &myInt;
myVar = 20;
myVar = *myScore;
*myScore = 30;
myVar = 40;
myVar = *myScore;
}
Group of answer choices
30
20
10
0
Answer: 30
Explanation:
In this program, first myInt is equal to 10, myScore will store the value of myInt.
In next line, myVar =20 and myVar will store the address of myScore where myScore is 30 and at last myInt will reflect the value of myVar that is 30.
Get Answers For Free
Most questions answered within 1 hours.