Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By MRK

CBSE CLASS XII

When I=4
Since Text[4] is ‘@’, Since which is not an alphabet,
(!isalpha(Text[I])) will becomes true.
Ie if(!isalpha(Text[I]))
Text[I]=’*’;
Ie Text[4]=’*’
Ie ‘*’ will be stored in place of ‘@’
Now the String Text[ ] =

When I=5
Since Text[5] is ‘W’, Upper Case Letter,
(isupper(Text[I]) will becomes true.
So Text[I] =Text[I]+1
So Text[5]=Text[5]+1
Text[5] =87(ASCII Value of W) + 1 = 88
=X(88 is ASCII Value of X)
Now the String Text[ ] =

When I=6
Since Text[6] is ‘o’, Which is a character, but which is not Upper case, else part will be executed.
Ie Text[I]=Text[I+1]
Here Text[6]=Text[6+1]
=Text[7]
Ie ‘r’ will be stored in place of ‘o’
Now the String Text[ ] =

When I=7
Since Text[7] is ‘r’, Which is a character, but which is not Upper case, else part will be executed.
Ie Text[I]=Text[I+1]
Here Text[7]=Text[7+1]=Text[8]
Ie ‘k’ will be stored in place of ‘r’
Now the String Text[ ] =

When I=8
Since Text[8] is ‘k’, Which is a character, but which is not Upper case, else part will be executed. Ie Text[I]=Text[I+1]
Here Text[8]=Text[8+1]
=Text[9]
Ie ‘!’ will be stored in place of ‘k’
Now the String Text[ ] =

When I=9
Since Text[9] is ‘!’, Since which is not an alphabet, (!isalpha(Text[I])) will becomes true.
Ie if(!isalpha(Text[I]))
Text[I]=’*’;
Ie Text[9]=’*’
Ie ‘*’ will be stored in place of ‘!’
Now the String Text[ ] =

Output: Nnd@*Xrk!*
e. Find the output of the following program: 2
#include<iostream.h>
void main( )
{ int U=10,V=20;
for(int I=1;I<=2;I++)
{ cout<<”[1]”<<U++<<”&”<<V – 5 <<endl;
cout<<”[2]”<<++V<<”&”<<U + 2 <<endl;
}
}

Ans: Output:

Paper By Mr. MRK
Email Id : [email protected]@yahoo.com