What is the output of the program?
#include
using namespace std;
int main()
{
int tab[4]={10,20,30,40};
tab[1]=10;
int *p;
p=&tab[0];
cout<<*p;
return 0;
}
Suggested Answer: A
Get Premium CPA-21-02 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
2 comments · newest first
RE
Remona
23 hours ago
I'm not entirely sure, but I remember something about how changing `tab[1]` to 10 shouldn't affect what `p` points to.
JA
Jade
6 days ago
I think the output should be 10 because `p` points to the first element of the array, which is `tab[0]`.