//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]);    
    }
}

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

 

కామెంట్‌లు

ఈ బ్లాగ్ నుండి ప్రసిద్ధ పోస్ట్‌లు

100% C prog to write content into a file and then read it back onto the console

Spic macay

శ్రీరస్తు.. రామలింగ 18-1-24 (సూరసాని వారి ఆహ్వానము)