recategorized by
2,571 views
0 votes
0 votes

What will be the output of the following c-code?

void main () 
{ 
   char *p= "ayqm";
   char c;  
   c=++*p;  
   printf ("%c" , c);  
}
  1. $a$
  2. $c$ 
  3. $b$
  4. $q$
recategorized by

1 Answer

–1 votes
–1 votes
Option C

++*p   ====>++(*p) due to precedence table in C

(*p)=a

++(*p)=b; but here *p is a string constant which cannot be changed

so there is runtime error

there is one more error

in intialization *P capital Pis used and

in line c=++(*p); small p is used which is not declared
edited by

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
3
makhdoom ghaya asked Sep 15, 2016
1,407 views
The data type created by the data abstraction process is calledClassStructureAbstract data typeUser defined data type
0 votes
0 votes
0 answers
4