hey everyone, im new, and i have a simple question.

im writing this basic code for my class to input six different check amounts, then give the total and average. so far i have it so it works perfect with whole number. the only problem is, the numbers i need to use have decimals, and everytime i try and enter a value like 12.34, the whole things goes crazy. my code is a series of

cout << "Enter the amount of first check:    " << endl;
	int check1;
	cin >> check1;

how can i fix this? thanks in advance


Re: simple question 80 80

Use "float" instaed of "int" O.K.

Re: simple question 80 80

dude ur awesome. thanks. now looking back i see that it is the correct data type. thanks again

Re: simple question 80 80

No problem! I'm still learning this crazy language myself. C+ is a brutal passion.
Glad I could help :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.