+1 vote
by kratos

Find the output of the following program:

#include<iostream.h>

int main()

{

int *Queen,Moves[]={11,22,33,44};

Queen=Moves;

Moves[2]+=22;

cout<<"Queen @"<<*Queen<<endl;

*Queen-=11;

Queen+=2;

cout<<"Next @"<<*Queen<<endl;

Queen++;

cout<<"Finally @"<<*Queen<<endl;

cout<<"New Origin @"<<Moves[0]<<endl;

}

1 Answer

+4 votes
by kratos
 
Best answer

Output: Queen @11

Next @55

Finally @44

New Origin @0

...