mehak tandon
mehak tandon
8 years ago

what does if(p) and if(q) means?
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf("p");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}

Solution(By Examveda Team)

The Output of the above question is nullp nullq. And
If(p) and if(q) check the whether p and q are true. In the given program both p and q initialize as null and zero which means false. Therefore else statement has execute.

This Question Belongs to User Ask Question >> Miscellaneous

Join The Discussion

Related User Ask Questions