Counting number of Positive integers under 100,000 with 6 or less factors?

Counting number of Positive integers under 100,000 with 6 or less factors?
0

#1

This is what I have so far… it will run just does not display anything.

int main()
{
	int PosInteger = 2, TotalNum = 0;
	int nStop = sqrt(PosInteger);

	for ( int NumofFac = 2; NumofFac <= 6 && PosInteger <= nStop; NumofFac++) {
		if (PosInteger % NumofFac == 0 && PosInteger % 2 == 0) {
			PosInteger++;  
			while (PosInteger < 100000) {
				TotalNum++;  
			}
			
		}
		cout << "total number of positive integers under 100,000 with 6 factors is " << TotalNum << endl;
	}
	return 0;
}

#2

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.