Page 154 - C++
P. 154
{
*(ptr+counter) = tolower(*(ptr+counter));
}
}
void main()
{
clrscr();
int position = 0;
char message[]= “POINTERS FUN”;
changestring(message, position);
cout<<message<< “@” <<position;
}
(f) Observe the following program and find out, which output(s) out of (i) to (iv) will be expected from the
program? What will be the minimum and the maximum value assigned to the variable Begin? (2)
Note: Assume all required header files are already being included in the program.
void main()
{
randomize();
int Begin=3,stop;
for(int Run=1;Run<4;Run++)
{
stop=random(Begin)+6;
cout<<Begin++<<stop<<”*";
}
}
(i) 36*46*59*
(ii) 37*46*56*
(iii) 37*48*57*
(iv) 35*45*57*