Error lvalue

Hello, I am doing a project for college lab that requires taking a random file with a bunch of numbers in it, ask the user what the filename is, and output the numbers until the console window is full. It is then supposed to pause the system and output the min, max, and average of the numbers on the window. The problem I am having is when counting the numbers to see if the system window is full, the if(count%20 = 0) has a error on the count dealing with a valid lvalue. Here is what I have so far (havne't put in the min, max, and average yet).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>    
#include <fstream>					
#include <string>
using namespace std;

int main()
{
	string filename;
	cout << "Enter file name: ";
	cin >> filename;
    ifstream myFile(filename);
	if (myFile.fail())				
	{
		cout << "Error: main(): Failed to open the file: ";
		cout << filename << endl;
	}
	else
	{
		double x;
		int i = 0;
		int count = 0;
		do
		{
			myFile >> x;
			while (!myFile.eof())
			{
				cout << x << endl;
				count ++;
				if(count%20=0)
					{
						system("pause");
					}
			}
		} while (!myFile.eof());
	}
	myFile.close();
	cout << endl;
	system("pause");
	return 0;
} 
if(count % 20 == 0)
Thanks! Why does it require the ==?
'=' means assignment.
'==' means logical equal compare.
Thanks. I am also having a trouble with the output. When I run the program with a file that has say
348967
345345
345434
3454
454
453
4
45
45
4
3
45
43
45
as numbers in the file, the output is only grabbing the first number.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>    
#include <fstream>					
#include <string>
using namespace std;

int main()
{
	string filename;
	cout << "Enter file name: ";
	cin >> filename;
    ifstream myFile(filename);
	if (myFile.fail())				
	{
		cout << "Error: main(): Failed to open the file: ";
		cout << filename << endl;
	}
	else
	{
		double x;
		int i = 0;
		int count = 0;
		do
		{
			myFile >> x;
			if (!myFile.eof())
			{
				cout << x << endl;
				count ++;
				if(count%20=0)
					{
						system("pause");
					}
			}
		} while (!myFile.eof());
	}
	myFile.close();
	cout << endl;
	system("pause");
	return 0;
} 

I think it should work. But, actually, it's very bad code.
Thanks a bunch! And I'm pretty new to programming, I am only basing how I write it off what the professor does in class =\ Thanks again though!
Topic archived. No new replies allowed.