...
UGC NET CS 2010 June-Paper-2
October 24, 2023
DSSSB TGT 2017
October 24, 2023
UGC NET CS 2010 June-Paper-2
October 24, 2023
DSSSB TGT 2017
October 24, 2023

UGC NET CS 2010 June-Paper-2

Question 12
What will be the output of the following c-code ?
void main ( )
{
char *P = “ayqm” ;
char c;
c = ++*p ;
printf (“%c”, c);
}
A
a
B
c
C
b
D
q
Question 12 Explanation: 
Pointer “p” will point to the string “ayqm”,
*p means the first character of the string which is “a”
++*p means an increment of “a” which is nothing but “b”
printf (“%c”, c); means the character “b” will be printed as output.
Note: They given syntax error in program.
Correct Answer: C
Question 12 Explanation: 
Pointer “p” will point to the string “ayqm”,
*p means the first character of the string which is “a”
++*p means an increment of “a” which is nothing but “b”
printf (“%c”, c); means the character “b” will be printed as output.
Note: They given syntax error in program.

Leave a Reply

Your email address will not be published. Required fields are marked *