Advertisement
vvccs

percentage

Jun 6th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class record{
  5.     public:
  6.         int S1;
  7.         int S2;    
  8.         int S3;
  9.         int S4;
  10. };
  11.  
  12. int main()
  13. {
  14.     int S1,S2,S3,S4;
  15.     record a;
  16.     a.S1=S1;
  17.     a.S2=S2;
  18.     a.S3=S3;
  19.     cout<<"Enter the marks of Subject 1 out of 80 ";
  20.     cin>>S1;
  21.     cout<<"Enter the marks of Subject 2 out of 80 ";
  22.     cin>>S2;
  23.     cout<<"Enter the marks of Subject 3 out of 80 ";
  24.     cin>>S3;
  25.     cout<<"Enter the marks of Subject 4 out of 80 ";
  26.     cin>>S4;
  27.     cout<<"The Average score is "<<(a.S1+a.S2+a.S3+S4)/4<<endl;
  28.     cout<<"The Percentage is "<<(a.S1+a.S2+a.S3+S4)*10/32<<endl;
  29.     return 0;
  30. }
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement