For loop not incrementing?

So, yes, this is technically a homework question but I'm on the right track, I just don't understand why my for loop isn't incrementing the way it should. All it prints to the screen is 1_____1 over and over and over again when it should be stopping at 5 in the loop?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

int main()
{
	int taxAmount;
	
	cout<<"Amount       With tax"<<endl;
	cout<<"-----------------------------------"<<endl;
	
	for(int i = 1; i<=5; i+=.25)
	{
		taxAmount = i*0.045;
		cout<<(i)<<"       "<<(i+taxAmount)<<endl;
	}
	system("pause");
	return 0;
}
The variable i is an integer so you can't increment it with a .25
Try for(float i = 1; i <=5; i+=.25)
No wonder. I'm an idiot lol
Topic archived. No new replies allowed.