Anonymous

1. Write A C++ Program To Calculate Average Marks Scored By A Student For 3 Subjects?

4

4 Answers

Anonymous Profile
Anonymous answered
1. Write a C++ program to calculate average marks scored by a student for 3 subjects.
Anonymous Profile
Anonymous answered
#include
#include
void main()
{clrscr();
float a,b,c,average;
couta>>b>>c;
average= (a+b+c)/5
cout
keshab Profile
keshab answered
#include<stdio.h>
#include<conio.h>

void main()

{
int sum,no;
int I,j,k;
float avg;
int std_marks[100];
clrscr();
sum=0;
printf("Please enter the number of student appear in the examination n::");
scanf("%d",&no);
printf("Please enter the marks of %d student one by onen",no);

for(I=1;I<=no;I++)
  {
  scanf("%d",&std_marks[I]);
  }
for(j=1;j<=no;j++)
{
   sum=sum+std_marks[j];
}
avg=sum/no;
printf("The marks of the students are as followsn");
for(k=1;k<=no;k++)
  {
  printf("nRoll NO =%d marks %d",k,std_marks[k]);
  }
printf("nnnThe average marks is %f",avg);

getch();
}

Answer Question

Anonymous