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

}

తెర మీద
 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

కామెంట్‌లు

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

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

Spic macay

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