Find and Print Average Marks of 5 Subjects – C Program

#include <stdio.h>
#include <conio.h>

//Find average marks of 5 subjects - FScOnline.info

int main()
{
  int a,b,c,d,e,average;
  
  printf("Enter marks of subject 1: ");
  scanf("%d",&a);
  printf("Enter marks of subject 2: ");
  scanf("%d",&b);
  printf("Enter marks of subject 3: ");
  scanf("%d",&c);
  printf("Enter marks of subject 4: ");
  scanf("%d",&d);
  printf("Enter marks of subject 5: ");
  scanf("%d",&e);
  
  average=(a+b+c+d+e)/5;
  printf("\nAverage: %d",average);
  
  getch();
  return 0;
}

 Output

c-program-to-find-average-of-5-subjects

Categories: C Language,C Programs,Computer Science

Tags: ,

Leave A Reply

Your email address will not be published.

×