C
Programming and Technical
Predict the output or error(s) for the following programmes:
void main()
{i
nt const * p=5;
printf("%d",++(*p));
}
Answer: Compiler error: Cannot modify a constant value.
Explanation: p is a pointer to a "constant integer". But we tried to change the value of the
"constant integer".
38. main()
{
char s[ ]="man";
int i;
for(i=0;s[ i ];i++)
printf("n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}
Read Solution (Total 1)
-
- Answer: mmmmaaaannnn
- 8 years agoHelpfull: Yes(1) No(0)
C Other Question