Write a program to calculate the average of five subjects marks and print fail if it is less than 35%. | CODE WITH SHARAD

Write a program to calculate the average of five subjects marks and print fail if it is less than 35%.

Written by Sharad Raj on 13th of March, 2018

BASIC PROGRAMS   C LANGUAGE PROGRAMS

PROGRAM CODE

#include<stdio.h>

#include<conio.h>

void main()

{
float a,b,c,d,e,f,avg;

clrscr();

printf(“enter the marks obtained in five subjects respectively : “);

scanf(“%f%f%f%f%f”,&a,&b,&c,&d,&e);

avg=(a+b+c+d+e)/5;

if(avg<35)

{

printf(“Average is %f student is fail.”,avg);

}

else

{

printf(“Average is %f student is pass.”,avg);

}

getch();

}


Comments


Contact