This C program finds the percentage of students marks and classifies them according to percentage. This is a part of Mumbai University MCA Colleges C programs MCA Sem 1
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
float m1,m2,m3;
float per;
printf("Enter the marks of three subjects out of 100");
scanf("\n %f %f %f",&m1,&m2,&m3);
if(m1<0 || m2<0 || m3<0)
{
printf("Marks cant be negetive");
}
else
{
if(m1<35 || m2<35 || m3<35)
{
printf("You have failed");
}
else
{
per=(m1+m2+m3)/3;
if(per>=75)
{
printf("You got distinction with %f percentage",per);
}
else if (per>=60)
{
printf("You got a 1st class with %f percentage",per);
}
else if(per>=45)
{
printf("You got 2nd class with %f percentage",per);
}
else
{
printf("You got pass class with %f percentage",per);
}
}
}
getch();
}
Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
float m1,m2,m3;
float per;
printf("Enter the marks of three subjects out of 100");
scanf("\n %f %f %f",&m1,&m2,&m3);
if(m1<0 || m2<0 || m3<0)
{
printf("Marks cant be negetive");
}
else
{
if(m1<35 || m2<35 || m3<35)
{
printf("You have failed");
}
else
{
per=(m1+m2+m3)/3;
if(per>=75)
{
printf("You got distinction with %f percentage",per);
}
else if (per>=60)
{
printf("You got a 1st class with %f percentage",per);
}
else if(per>=45)
{
printf("You got 2nd class with %f percentage",per);
}
else
{
printf("You got pass class with %f percentage",per);
}
}
}
getch();
}
Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.
No comments:
Post a Comment