20. Identify the possible error(s) in the following code fragment. Discuss the reason(s) of error(s) and
correct the code :
:
f = 1;
for (int a = 40 ; (a); a--)
f*= a;
S = 0;
for (int a = 1 ; a < 40/a++)
S + = a;
]
Answers
Answered by
7
Question:
Identify the possible error(s) in the following code fragment. Discuss the reason(s) of
f = 1;
for (int a = 40 ; (a); a--)
f*= a;
S = 0;
for (int a = 1 ; a < 40/a++)
S + = a;
To find:
Error
Explanation :
error are. for (int a = 40 ; (a); a--)
for (int a = 1 ; a < 40/a++)
Have a nice day and follow me
Similar questions
Social Sciences,
2 months ago
Biology,
2 months ago
Math,
2 months ago
English,
5 months ago
English,
10 months ago