Sunday, July 31, 2016

Marks calculation program in C Language

Marks calculation program in C Language

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f,sum,pern,flage=0;
float pernn;
clrscr();
printf("\tEnter the marks of six subjecets\n\n\n");
printf("Enter the marks of Maths::");
scanf("%d",&c);
printf("Enter the marks of Social Science::");
scanf("%d",&a);
printf("Enter the marks of English::");
scanf("%d",&b);
printf("Enter the marks of Hindi::");
scanf("%d",&d);
printf("Enter the marks of Science::");
scanf("%d",&e);
printf("Enter the marks of Sanskrit::");
scanf("%d",&f);
if(a>100||b>100||c>100||d>100)
{
printf("\n\n\nEntered Marks are invalid so plz re-enter your marks again");
flage=2;
}
if(flage!=2)
{
sum=a+b+c+d+e+f;
pern=(sum*1)/6;
printf("\n\nthe percentage of your ward is :: %d\n\n ",pern );
if(a<40||b<40||c<40||d<40){
printf("Sorry he/she is failed");flage=1;
}
if(flage==0){

if(pern>=60)
printf("Congratulation your ward got first divison");
else
{
if(pern>=50 || pern<60)
printf("Congratulation your ward got second Division");
else
{
if(pern>=40 || pern<50)
printf("Congratulation your ward got third division");
}
}
}
}
printf("\n\n\nThanks for choosing our Marks calculation programme in C");
getch();
}




Out Put

/* Enter the marks of six subjecets

Enter the marks of Maths::78
Enter the marks of Social Science::86
Enter the marks of English::68
Enter the marks of Hindi::90
Enter the marks of Science::98
Enter the marks of Sanskrit::99


the percentage of your ward is :: 86

Congratulation your ward got first divison


Thanks for choosing our Marks calculation programme in C

No comments:

Post a Comment