Answer to Question #248916 in C++ for abdu

Question #248916

a c++ program that reads 5 scores and how much each scores differ from the the highest score 


1
Expert's answer
2021-10-09T04:44:59-0400
#include <iostream>


using namespace std;




void main(){
	float scores[5],max=0; 
	for(int i=0;i<5;i++){
		cout<<"Enter score "<<(i+1)<<": "; 
		cin >> scores[i];
		if(scores[i]>max){
			max=scores[i];
		}
	}
	cout<<"\nThe highest score is: "<<max<<"\n\n";	 
	for(int i=0;i<5;i++){
		int diff=max-scores[i];
		cout<<"The score "<<scores[i]<<" differs from max by "<<diff<<"\n";
	}


	system("pause");
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS