//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);
}
#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
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
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.