What will be the output of the following C program include u

What will be the output of the following C++ program: #include using namespace std; int main() {int *list=new int|10], list(0J=10, list! 11=20; b list(3]=30; int *temp; temp=list+1; cout

Solution

question2:

answer:

here you take the list array as pointer and inserted 10 20 and 30 in the respected index as 0 1 3

then list that intially at the 0th position

then you are adding list with 1 (list+1) then the list become 1 that is the list position changes from 0 to 1 by adding it to 1.

finally you print the temp that temp containes the value in list[1] that is 20

question3:

answer:true

constructors are special functions which has same name as class name and it is used to initialize the values.

 What will be the output of the following C++ program: #include using namespace std; int main() {int *list=new int|10], list(0J=10, list! 11=20; b list(3]=30; i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site