Teaching HPSC Lecturer (Technical) Mock Test 2024 Programming and Data Structure Programming in C While Loop
Find the number of times ‘for’ loop runs successfully and the output printed by variable ‘sum’ for the below given code.
#include
int x = 14;
int fun() {
return x--;
}
int main () {
int sum = 0;
for(fun();--x;fun())
sum = sum + fun();
printf("%d",sum);
return 0;
}1
4, 30
2
5, 26
3
4, 26
4
5, 30
5
Question Not Attempted