Step 1: Use first law of thermodynamics.
\[
Q = \Delta U + W
\]
Here, \(W\) is work done by the gas.
Step 2: Analyze process AB.
From the \(P-V\) diagram, AB is vertical, so volume remains constant.
\[
W_{AB}=0
\]
Given heat absorbed during AB is:
\[
Q_{AB}=60\,J
\]
Therefore,
\[
\Delta U_{AB}=60\,J
\]
Step 3: Find internal energy at B.
\[
U_A=1450\,J
\]
\[
U_B=U_A+\Delta U_{AB}
\]
\[
U_B=1450+60=1510\,J
\]
Step 4: Analyze process BC.
Given no heat is exchanged during BC:
\[
Q_{BC}=0
\]
Work of \(40\,J\) is done on the gas, so work done by the gas is:
\[
W_{BC}=-40\,J
\]
Using first law:
\[
0=\Delta U_{BC}+(-40)
\]
\[
\Delta U_{BC}=40\,J
\]
Step 5: Find internal energy at C.
\[
U_C=U_B+\Delta U_{BC}
\]
\[
U_C=1510+40=1550\,J
\]
Step 6: Analyze process CA.
Given heat is rejected during CA:
\[
Q_{CA}=-80\,J
\]
Internal energy change during CA is:
\[
\Delta U_{CA}=U_A-U_C
\]
\[
\Delta U_{CA}=1450-1550=-100\,J
\]
Step 7: Calculate work done by gas during CA.
Using first law:
\[
Q_{CA}=\Delta U_{CA}+W_{CA}
\]
\[
-80=-100+W_{CA}
\]
\[
W_{CA}=20\,J
\]
\[
\boxed{20\,J}
\]
Hence, correct answer is option (B).