100% total of marks of a student in 4 subjects using array concept
//program to find total of marks of 4 subjects of a student using array concept
#include <stdio.h>
void main()
{
int i,marks[4],total=0;
for(i=0;i<4;i++)
{
printf("\n enter the marks in subject %d:",i+1);
scanf("%d",&marks[i]);
total=total+marks[i];
}
printf("\n sum of the marks of 4 subjects =%d",total);
}
#include <stdio.h>
void main()
{
int i,marks[4],total=0;
for(i=0;i<4;i++)
{
printf("\n enter the marks in subject %d:",i+1);
scanf("%d",&marks[i]);
total=total+marks[i];
}
printf("\n sum of the marks of 4 subjects =%d",total);
}
output తెర మీద ఇలా
enter the marks in subject 1:20
enter the marks in subject 2:21
enter the marks in subject 3:19
enter the marks in subject 4:21
sum of the marks of 4 subjects =81
enter the marks in subject 2:21
enter the marks in subject 3:19
enter the marks in subject 4:21
sum of the marks of 4 subjects =81
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.