Source Code:
#include <stdio.h>
#include <conio.h>
// A program to obtain percentage....By Akshay...
void main()
{
float bme,bcp,eees,comm,phy,total,percentage;
clrscr();
printf("\n Enter the marks of BME = ");
scanf("%f",&bme);
printf("\n Enter the marks of BCP = ");
scanf("%f",&bcp);
printf("\n Enter the marks of EEES = ");
scanf("%f",&eees);
printf("\n Enter the marks of. Communication Skills = ");
scanf("%f",&comm);
printf("\n Enter the marks of Physics = ");
scanf("%f",&phy);
total = bme+bcp+eees+comm+phy;
printf("\n Total makrks obtained = %f" ,total);
percentage = total*0.2;
printf("\n Percentage Obtained = %f" ,percentage);
getch();
}
//Done
After writing the source code save with extension .CPP
Output:
No comments :
Post a Comment