//100% Arrays: finding total marks subject-wise in 2 exams
/* A STUDENT wrote quarterly and half yearly exams in 4 subjects say Telugu, Hindi,maths,social. We want to print totals in each subject.  marks are for quarterly and marks are for half-yearly */
#include<stdio.h>
void main()
{
int i, temp,marksq[]={90,95,99,90}, marksh[]={91,90,99,91};
for(i=0;i<4;i++)
{
temp= marksq[i]+marksh[i];
printf("\n total marks in subject %d in quarterly ",i+1);
printf(" and half-yearly = %d",temp);
}
}
  
#include<stdio.h>
void main()
{
int i, temp,marksq[]={90,95,99,90}, marksh[]={91,90,99,91};
for(i=0;i<4;i++)
{
temp= marksq[i]+marksh[i];
printf("\n total marks in subject %d in quarterly ",i+1);
printf(" and half-yearly = %d",temp);
}
}
తెర మీద
 total marks in  subject 1 in quarterly  and half-yearly =  181  
 total marks in  subject 2 in quarterly  and half-yearly =  185
 total marks in  subject 3 in quarterly  and half-yearly =  198  
 total marks in  subject 4 in quarterly  and half-yearly =  181
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.