//prog to fin no of subjects in which marks increased from quarterly to half yearly

/*program to find sum of marks in 4 subjects of  a student*/
#include<stdio.h>
void main()
{
  int j=0,i=0,total=0,marksq[]={90,95,99,90},marksh[]={91,91,99,92};

do
{
    printf("\n total marks in  subject %d = %d", i+1,marksq[i]+marksh[i]);
    total=total+marksq[i]+marksh[i];
    if(marksq[i]<marksh[i])
    {
        j=j+1;  //this is counting the subjects in which improvement is there
    }
    i=i+1;
   
}while(i<4);
printf("\n grand total=%d",total);
printf("\n no of subjects in which marks increased=%d",j);
}

తెరమీద
total marks in  subject 1 = 181
 total marks in  subject 2 = 186
 total marks in  subject 3 = 198
 total marks in  subject 4 = 182
 grand total=747
no of subjects in which marks increased=2

కామెంట్‌లు

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

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

Spic macay

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