multiarray- ex-1
#include <stdio.h>
int main() {
// Write C code here
int students=2;
int subject=2;
int marks[3][5];
for (int i = 0 ; i <students; i++){
for (int j = 0 ; j <subject; j++){
printf("enter the marks of student %d in subject %d\n" , i+1 , j+1);
scanf("%d", &marks[i][j]);
}
}
for (int i = 0 ; i <students; i++){
for (int j = 0 ; j <subject; j++){
printf(" Student %d got %d marks in subject %d\n" , i+1 , marks[i][j] , j+1);
}
}
return 0;
}
Comments
Post a Comment