/*
Declare a one-dimensional array of type float and of maximum size 100. 
Then ask the user to enter the actual size of the array (the number of 
elements that will be used). The read the array. Then ask the user to 
enter a real number to search for and print how many times the number 
appears in the array.
*/

#include <iostream>
using namespace std;
int main()
{
	const int n = 100;
	float a[n], number;
	int i, size, count = 0;
	cout << "Enter the size of the array (< 101): ";
	cin >> size;
	if (size > 0 && size <= 100)
	{
		cout << "Enter " << size << " real numbers: " << endl;
		for (i = 0; i < size; i++)
			cin >> a[i];
		cout << "Enter a real number to search for: ";
		cin >> number;
		for (i = 0; i < size; i++)
			if (a[i] == number)
				count++;
		cout << number << " appears in the array "
			<< count << " times." << endl;
	}
	else
		cout << "Invalid size.\n";
	return 0;
}
