sahajjain01

Calculate percentage of 5 subjects.

Aug 4th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. //Program to calculate percentage of 5 subjects.
  2. #include<iostream.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6.     clrscr();
  7.     int a,b,c,d,e;
  8.     cout<<"Enter marks of 1st subject: ";
  9.     cin>>a;
  10.     cout<<"Enter marks of 2nd subject: ";
  11.     cin>>b;
  12.     cout<<"Enter marks of 3rd subject: ";
  13.     cin>>c;
  14.     cout<<"Enter marks of 4th subject: ";
  15.     cin>>d;
  16.     cout<<"Enter marks of 5th subject: ";
  17.     cin>>e;
  18.     a=(a+b+c+d+e)/5;
  19.     cout<<"The percentage is: "<<b<<"%";
  20.     getch();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment