• closed by
368 views
1 1 vote
closed with the note: Multiple posting of the same question

int main()

{

Char *str=”Gate2017”;

printf(“%d”, fun( str ));

return 0;

}

int fun(char *P1)

{

Char *P2=P1;

while (*++P1)

      return (P1-P2);

}

The output of the above program will be ______

Answer given is 8...pls help

Position:
Show:

Related questions

8 8 votes
1 1 answer
238
238 views
GO Classes asked Jun 6
238 views
What is the output of the following code?#include <stdio.h void fun() { static int x = 3; int y = 2; x = x + y; y = y + x; printf("%d ", x); } int main() { fun(); fun(); ...
0 0 votes
1 1 answer
1.3k
1.3k views
saif asked Jun 2, 2018
1,341 views
How can we identify whether a function is call by value or call by refrence?? by looking at the defination or by looking at the statement where it is called.please someon...
2 2 votes
1 answers 1 answer
1.5k
1.5k views
suneetha asked Aug 31, 2017
1,472 views
#include <stdio.h #include <stdarg.h int fun(int n, ...) { int i, j = 1, val = 0; va_list p; va_start(p, n); for (; j < n; ++j) { i = va_arg(p, int); val += i; } va_end(p...
8 8 votes
1 1 answer
234
234 views
GO Classes asked Jun 6
234 views
What is the output of the following code?#include <stdio.h void change(int *p, int *q) { *p = *p + 4; *q = *p + *q; p = q; *p = *p - 3; } int main() { int a = 6, b = 10; ...