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)

C Other Question

What is a null pointer assignment error? What are bus errors, memory faults, and
core dumps?
main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}
find output