Consider the following function written in the C.
int fun1(char *s)
{
int len, c;
char *begin, *end, temp;
len = fun2(s);
begin = s;
end = s;
for (c = 0; c < len - 1; c++)
end++;
for (c = 0; c < len/2; c++)
{
temp = *end;
*end = *begin;
*begin = temp;
begin++;
end--;
}
return 0;
}
int fun2(char *p)
{
int c = 0;
while( *(p + c) != '\0' )
c++;
return c;
}
The output of the above function 'fun1' on input “testbook” is1
okbostte
2
ettsobko
3
booktest
4
koobtset