Making 2 dimentional arry in c
#include<stdio.h>
int main()
{
int n_students = 2;
int n_subjects = 6;
int i,j;
int markes[2][6];
for(i=0; i<n_students ; i++){
for(j=0; j<n_subjects ;j++){
printf("Enter the markes of students %d in subject %d \n",i+1,j+1);
scanf("%d", &markes[i][j]);
}
}
for(i=0; i<n_students ; i++){
for(j=0; j<n_subjects ;j++){
printf("The markes of students %d in subject %d is: %d\n",i+1,j+1,markes[i][j]);
}
}
return 0;
}
Comments
Post a Comment