Rotate your phone or change to desktop for better experience

Rotate your phone or change to desktop for better experience

Program to read marks scored by a students and find the average of marks

 

Program to read marks scored by a students and find the average of marks

#include<stdio.h>

void main()

{

    int i;

    float mark[5], sum=0, avg;

    printf("Enter Marks obtained in 5 Subjects:\n");

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

    {

        scanf("%f", &mark[i]);

        sum = sum+mark[i];

    }

    avg = sum/5;

    printf("\nAverage Marks = %f", avg);

}

Post a Comment

0 Comments