#include int main() { int a,b,c,d,e,f; float sum =0; float avg; printf("\n enter marks:\n"); printf("P,C,B,M,E,H\n"); scanf(" %d %d %d %d %d %d",&a,&b,&c,&d,&e,&f); if(a<35 || b<35 || c<35 || d<35 || e<35 || f<35 ) { printf("\nresult: fail"); exit() ; } sum =a + b + c + d + e + f; avg=sum/6; printf("total : %f \naverage : %f",sum,avg); if(avg>=35 && avg<50) printf("\n result :third division "); else if(avg>=50 && avg <60) printf("\n result : second division"); else if(avg>=60 && avg<75) printf("\n result : first division "); else if(avg>75 && avg <=100) printf("\n result : distinction"); return 0; } note:- why this code is not run ...
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
int main()
{
int a,b,c,d,e,f;
float sum =0;
float avg;
printf("\n enter marks:\n");
printf("P,C,B,M,E,H\n");
scanf(" %d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
if(a<35 || b<35 || c<35 || d<35 || e<35 || f<35 )
{
printf("\nresult: fail");
exit() ;
}
sum =a + b + c + d + e + f;
avg=sum/6;
printf("total : %f \naverage : %f",sum,avg);
if(avg>=35 && avg<50)
printf("\n result :third division ");
else
if(avg>=50 && avg <60)
printf("\n result : second division");
else
if(avg>=60 && avg<75)
printf("\n result : first division ");
else
if(avg>75 && avg <=100)
printf("\n result : distinction");
return 0;
}
note:- why this code is not run ...

Step by step
Solved in 2 steps with 1 images









