Meka thama question eka mata mekata coding tika kiyanavada..Simple program 1k..arrays & loops use karanna oni...
Suppose there are 4 students each having marks of 3 subjects. Write a program to read the marks from the keyboard and calculate and display the total marks of each students. Use a 2-D array to store marks. An example would be as follows.
Enter the marks of four students, on four rows:
50 60 80
60 75 90
30 49 99
66 58 67
Total marks of four students:
190
225
178
191
Meka thama mage program eka...Eth segmentation fault kiyala enava...I am new for C programming...Help me...
#include<stdio.h>
int main()
{
int i,j;
int tot;
int a[4][3];
printf("Enter marks of four students, on four rows: \n");
for(i=0;i<4;i++);
{
tot=0;
for(j=0;i<3;j++)
{
scanf("%d",&a[j]);
tot+=a[j];
}
}
printf("Total marks of four students: \n");
for(i=0;i<4;i++)
{
printf("%d\n",tot);
}
return 0;
}
Suppose there are 4 students each having marks of 3 subjects. Write a program to read the marks from the keyboard and calculate and display the total marks of each students. Use a 2-D array to store marks. An example would be as follows.
Enter the marks of four students, on four rows:
50 60 80
60 75 90
30 49 99
66 58 67
Total marks of four students:
190
225
178
191
Meka thama mage program eka...Eth segmentation fault kiyala enava...I am new for C programming...Help me...
#include<stdio.h>
int main()
{
int i,j;
int tot;
int a[4][3];
printf("Enter marks of four students, on four rows: \n");
for(i=0;i<4;i++);
{
tot=0;
for(j=0;i<3;j++)
{
scanf("%d",&a[j]);
tot+=a[j];
}
}
printf("Total marks of four students: \n");
for(i=0;i<4;i++)
{
printf("%d\n",tot);
}
return 0;
}
