Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to calculate percentage of 5 subjects.
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- int a,b,c,d,e;
- cout<<"Enter marks of 1st subject: ";
- cin>>a;
- cout<<"Enter marks of 2nd subject: ";
- cin>>b;
- cout<<"Enter marks of 3rd subject: ";
- cin>>c;
- cout<<"Enter marks of 4th subject: ";
- cin>>d;
- cout<<"Enter marks of 5th subject: ";
- cin>>e;
- a=(a+b+c+d+e)/5;
- cout<<"The percentage is: "<<b<<"%";
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment