edited by
1,433 views
2 votes
2 votes
Consider the following C code:
include <stdio.h>
int fun()
{
static int num=25;
return num--;
}
int main()
{
for(fun( ); fun();fun())
printf("%d", fun( ));
return O;
}
The sum of the values printed by the above program will be

 

edited by

1 Answer

1 votes
1 votes
It won't do anything , it will have compilation error.

Used : instead of ;

If we consider it without errors , equivalent while loop can be written as :-

fun(); //initialization

while(fun()//termination condition when fun() gets 0) {

print("%d",fun());

fun();

}

which will print :-

2320171411852

Related questions

0 votes
0 votes
1 answer
1
Markzuck asked Jan 10, 2019
494 views
Please explained detialed execution of this code, I am not getting how int stored in char, like we can interchange using ASCII but still cant store right?
1 votes
1 votes
0 answers
3
2 votes
2 votes
0 answers
4