Computer Science, asked by mayank14309, 5 months ago

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 singhaniket637
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