Skip to content

Instantly share code, notes, and snippets.

@ThePratikSah
Created July 17, 2017 18:26
Show Gist options
  • Save ThePratikSah/3a835a84d45d9d0552cfd78ebcc32963 to your computer and use it in GitHub Desktop.
Save ThePratikSah/3a835a84d45d9d0552cfd78ebcc32963 to your computer and use it in GitHub Desktop.
main() {
int marks[3][3], i, j, sum;
for (i = 0; i < 3; i++){
printf("Enter three subject marks of student %d\n", i+1);
for (j = 0; j < 3; j++)
scanf("%d", &marks[i][j]);
}
for (i = 0; i < 3; i++) {
sum=0;
for (j = 0; j < 3; j++)
sum = sum + marks[i][j];
printf("\nTotal marks of student %d is %d.", i+1, sum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment