Answer to Question #285553 in C++ for bura

Question #285553

1.     Read 10 integers from the keyboard in the range 0 - 100, and count how many of them are larger than 50, and display this result.


1
Expert's answer
2022-01-07T07:44:57-0500
#include<iostream>
using namespace std;


int main()
{
	int array[10];
	int integers_larger_50 = 0;
	cout << "Enter 10 integers in the range 0 - 100:";
	for (int i = 0; i < 10; i++)
	{
		cin >> array[i];
		cout << array[i];
		if (array[i] > 50)
			integers_larger_50++;
	}
	cout << "The number of integers is larger than 50: " << integers_larger_50 << endl;
	system("pause");
	return 0;
}

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