//program to find total of the marks of 3 subjects of 2 student using array concept
//program to find total of the marks of 3 subjects of 2 student using array concept
#include <stdio.h>
void main()
{
int i,j,marks[2][3],total[2]={0,0};
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
printf("\n enter the marks of student %d in subject %d:",i+1,j+1);
scanf("%d",&marks[i][j]);
total[i]=total[i]+marks[i][j];
}
printf("\n sum of the marks of student %d in %d subjects =%d",i+1,j,total[i]);
}
}
#include <stdio.h>
void main()
{
int i,j,marks[2][3],total[2]={0,0};
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
printf("\n enter the marks of student %d in subject %d:",i+1,j+1);
scanf("%d",&marks[i][j]);
total[i]=total[i]+marks[i][j];
}
printf("\n sum of the marks of student %d in %d subjects =%d",i+1,j,total[i]);
}
}
output తెర మీద ఇలా
enter the marks of student 1 in subject 1:20
enter the marks of student 1 in subject 2:20
enter the marks of student 1 in subject 3:30
sum of the marks of student 1 in 3 subjects =70
enter the marks of student 2 in subject 1:20
enter the marks of student 2 in subject 2:30
enter the marks of student 2 in subject 3:40
sum of the marks of student 2 in 3 subjects =90
enter the marks of student 1 in subject 2:20
enter the marks of student 1 in subject 3:30
sum of the marks of student 1 in 3 subjects =70
enter the marks of student 2 in subject 1:20
enter the marks of student 2 in subject 2:30
enter the marks of student 2 in subject 3:40
sum of the marks of student 2 in 3 subjects =90
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.