 CPP All : Pointer and Arrays Exam Paper Problems #### Output writing – Pointer to array #5204

( As In Exam - CBSE12A-2018 )

Find and write the output of the following C++ program code:
Note : Ass

Find and write the output of the following C++ program code:
Note : Assume all required header files are already included in the program.

```#define Modify(N) N*3+10
void main()
{
int LIST[]={10,15,12,17};
int *P=LIST, C;
for(C=3; C>=0; C--)
LIST[I]=Modify(LIST[I]);
for (C=0; C<=3; C++)
{
cout<<*P<<":";
P++;
}
}```

#### Output writing with pointer based traversing of an array #5318

( As In Exam - CBSE12A-2017 )

Find and write the output of the following C++ program code: Note: Assume al

Find and write the output of the following C++ program code: Note: Assume all required header files are already being included in the program.

```void main()
{
int *Point, Score[]={100,95,150,75,65,120};
Point = Score;
for(int L = 0; L<6; L++)
{
if((*Point)%10==0)
*Point /= 2;
else
*Point -= 2;
if((*Point)%5==0)
*Point /= 5;
Point++;
}
for(int L = 5; L>=0; L--)
cout<<Score[L]<<"*";
}```
Solved Problems #### Output Writing Based on char and int array reference #5051

Write output of the following code. Assume that all relevant header files hav

Write output of the following code. Assume that all relevant header files have been added.

```int main()
{
char *text = "AJANTA";
int *p, num[]={1,5,7,9};
p=num;
cout<<*p<<text<<endl;
text++;
p++;
cout<<*p<<text<<endl;
}```

#### Output Writing – Modifying and Reading int array using a pointer variable #5054

Write output of the following code.

```int main()
{
int *striker, t

```

Write output of the following code.

```int main()
{
int *striker, track[] = {10,20,30,40};
striker=track;
track+=30;
cout<<"striker"<<*striker<<endl;
*striker-=10;
striker++;
cout<<"Next@"<<*striker<<endl;
striker+=2;
cout<<"Last@"<<*striker<<endl;
cout<<"Rest to"<<track<<endl;
return 0;
}```

#### Output writing – Pointer to string and integer array #5376

Find and write the output of the following C++ program code.

Find and write the output of the following C++ program code.

#### Output writing – pointer and pointer value increment for array #7500

Find and write the output of the following C++ program code.

```int mai

```

Find and write the output of the following C++ program code.

```int main( )
{
int Ar[]={1,3,8,10,4,6,7} ;
int *Ptr= Ar, I ;
cout<<++*Ptr++ << '@' <<endl;
for( int x=0; x<7 ;x++) cout<<Ar[x]<<" ";
cout<<endl;
I = Ar - Ar ;
cout<<++*(Ptr+I)<<'@';
cout<<Ar[I]<<'@';
return 0;
}
```

#### Output writing – Pointer to string elements #7704

Find and write the output of the following C++ program code:
Note : Ass

Find and write the output of the following C++ program code:
Note : Assume all required header files are already included in the program.

```int main( )
{
char str[]="NOCONFUSION";
cout<<*str<<*(&str)<<endl;
cout.write(str,2)<<endl;
cout.write(str+2,9)<<endl;
return 0;
}```

#### Output writing – Pointer to string as char array #7709

Find and write the output of the following C++ program code:
Note : Ass

Find and write the output of the following C++ program code:
Note : Assume all required header files are already included in the program.

```void strpat(char *str)
{
for(int i=0;str[i]>0;i++)
{
for(int j=0;j<=i;j++)
{
cout<<str[j];
}
cout<<endl;
}
}
int main( )
{
char *t="CBSE";
strpat(t);
return 0;
}```

Exam Paper Problems:2  Solved Problems:6
×