What is the output of the following program?
int main ( )
{
char *str = “Gate2015”
printf (“%d”, gradeup (str)) ;
return 0;
}
int gradeup (char *P1)
{
char *P2 = P1 ;
while (*++P1) ;
return (P1 – P2);
}
How P1 points to null and P2 to starting based on that they gave answer as 8