You have written most of the code correctly. Only sum is missing.
Will modify your code by adding 2 new lines and modify two lines. That's it... Problem will be solved.
All changes were in bold for your reference
int i, j, sum;
printf("Two Dimensional array elements:\n");
for(i=0; i<3; i++)
{
sum = 0;
for(j=0;j<3;j++)
{
printf("%d ", disp[i][j]);
sum += disp[i][j];
}
printf("= %d\n", sum);
}
return 0;
}
}
return 0;
}