Monday 21 May 2012

DISPLAY RESULT OF ONE STUDENT THEIR PERCENTAGE AND CLASS


#include<stdio.h>
#include<conio.h>
void main()
{
float vb,java,database,total=300,sum,per,avg ;
clrscr();
printf("\nenter the marks for vb");
scanf("%f",&vb);
printf("\n enter the marks for java");
scanf("%f",&java);
printf("\nenter the marks for database");
scanf("%f",&database);
sum=vb+java+database;
printf("\nyour total is =%f",sum);
avg=sum/3;
printf("\nyour ang is=%f",avg);
per=sum/total*100;
printf("\nyour per is=%f",per);
if(per<35)
{
 printf("\nyou  have failed",per);
 }
 else if (per>35 && per<60)
 {
 printf("\nyou got second class%f",per);
 }
 else if (per>60 && per<75)
 {
 printf("\nfirst class%f",per);
 }
 else
 {
 printf("\ndistiction%f",per);
 }
 }
Output
enter the marks for vb90
enter the marks for java90
enter the marks for database90
your total is =270.000000
your ang is=90.000000
your per is=90.000000
distinction 90.000000

No comments:

Post a Comment