Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cout<<"Enter number of student"<<endl;
- cin>>n;
- int test[125],attendence[125],finalxm[125];
- for(int i=0;i<n;i++)
- {
- cout<<"Enter the marks of "<<i<<" th student"<<endl;
- cin>>test[i]>>attendence[i]>>finalxm[i];
- }
- int result[125];
- for(int i=0;i<n;i++)
- {
- result[i]=(test[i]+attendence[i]+finalxm[i]);
- }
- for(int i=0;i<n;i++)
- {
- if(result[i]>=80)
- {
- cout<<i+1<<"th student got A+"<<endl;
- }
- else if(result[i]>=75)
- {
- cout<<i+1<<"th student got A"<<endl;
- }
- else if(result[i]>=70)
- {
- cout<<i+1<<"th student got A-"<<endl;
- }
- else if(result[i]>=65)
- {
- cout<<i+1<<"th student got B+"<<endl;
- }
- else if(result[i]>=60)
- {
- cout<<i+1<<"th student got B"<<endl;
- }
- else
- {
- cout<<i+1<<"th student Failed"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment