Write the output of the following program


Write the output of the following program.

#include
using namespace std;
void fun1 (int *p, int *&q) {
*p = 100;
p = p + 2;
*p = *q;
*q = *(p+1);
cout << "p=" << *p << " q=" << *q << "n";
}

bool fun2 (int x[], int size) {
int *p = x;
int *q;
q = p;
for (int i=1; i
x[i] += x[i-1];
cout << x[i] << " ";
}
cout << "n";
fun1 (p, q);
return (*p == *q);
}

int main ( ) {
int a[5] = {2,4,6,8,10};
if (fun2 (a,5))
cout << "truen";
else
cout << "falsen";
for (int i=0; i<5; i++)
cout << a[i] << " ";
return 0;
}

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write the output of the following program
Reference No:- TGS0113144

Expected delivery within 24 Hours