Sunday, July 31, 2016

MARK SHEET- C Language

/* MARK SHEET */

#include<stdio.h>
#include<conio.h>
#include<process.h>
void main()
{
float per;
clrscr();
int m1,m2,m3,m4,m5,m6,t,x=0;
printf("Enter the marks m1,m2,m3,m4,m5,m6\n");
scanf("%d%d%d%d%d%d",&m1,m2,&m3,&m4,&m5,&m6);
t= m1+m2+m3+m4+m5+m6;
per=t/6;
if(m1<40||m2<40||m3<40||m4<40||m5<40||m6<40)
{
printf("Student is fail & per. is %f",per);
x=1;
}
if (x==1)
exit(0);
else
if (per<40)
{
printf("student is failed & per.is %f",per);
}
if (per>=40 && per<50)
{
printf("student is passed with third division & per.is%f",per);
}
if (per>=50 && per<60)
{
printf("student is passed with second division & per.is %f",per);
}
if (per>=60 && per<75)
{
printf("student is passed with first division & per. is %f.",per);
}
if (per>75)
{
printf("student is passed with hons.& per.is %f",per);
}
getch();
}

/************************OUTPUT***************************
Enter the marks m1,m2,m3,m4,m5,m6
45
69
35
33
96
83
student is failed & per.is 58.000000*/

No comments:

Post a Comment