UGC NET CS 2010 June-Paper-2
October 24, 2023DSSSB TGT 2017
October 24, 2023UGC 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);
}
void main ( )
{
char *P = “ayqm” ;
char c;
c = ++*p ;
printf (“%c”, c);
}
a | |
c | |
b | |
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.
*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.
*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.
Subscribe
Login
0 Comments