Question 9824 – Programming
February 13, 2024Question 9873 – Programming
February 13, 2024Question 9851 – Programming
The value of j at the end of the execution of the following C program.
int incr(int i) { static int count = 0; count = count + i; return (count); } main() { int i,j; for (i = 0; i <= 4; i++) j = incr(i); }
is
Correct Answer: A
Question 27 Explanation:
At i=0; count=0
i=1; count=1
i=2; count=3
i=3; count=6
i=4; count=10
It return count value is 10.
i=1; count=1
i=2; count=3
i=3; count=6
i=4; count=10
It return count value is 10.
10
4
6
7
Subscribe
Login
0 Comments