Computer Science, asked by janhavi567, 1 month ago

Write a program to store the marks of 5 subjects and calculate
and print the total and average.

Answers

Answered by kunjuzz91
0

Explanation:

# include<stdio.h>

#include<conio.h>

void main()

{

int marks[5];

int total=0;

float avg;

printf("Enter your 5 subject marks");

for(int i=0;i<5;i++)

{

scanf("%d",&a[i]);

total=total+a[i];

}

avg=(float)total/5;

printf("total marks:%d",total);

printf("Average:%f",avg);

getch();

}

Similar questions