# Another Coin Counting Program

This is a discussion on Another Coin Counting Program within the C++ Programming forums, part of the General Programming Boards category; I've been away from programming for a long time, and starting at this spot, but I get a wierd error ...

1. ## Another Coin Counting Program

I've been away from programming for a long time, and starting at this spot, but I get a wierd error that I can't remember how to fix..:

Code:
```///////////////////////////
// Coin program
// ------------
//
// Calculates which coins
// to give to a person
// if he pays a product
// with a certain amount
// of money..
///////////////////////////
//includes
#include <iostream.h>

//Start
int main() {
int money; //pengene
int en = 0, to = 0, fem = 0, ti = 0, tyve = 0, halvtreds = 0; //under 100
int hundrede = 0, tohundrede = 0, femhundrede = 0; //under 1000
int tusind = 0, totusind = 0, femtusind = 0; //resten
int y=0;
do {

cout << "What is the change amount?";
cin >> money;
if(money >= 5000) {
money -= 5000;
femtusind++;
continue;
}
if(money >= 2000) {
money -= 2000;
totusind++;
continue;
}
if(money >= 1000) {
money -= 1000;
tusind++;
continue;
}
if(money >= 500) {
money -= 500;
femhundrede++;
continue;
}
if(money >= 200) {
money -= 200;
tohundrede++;
continue;
}
if(money >= 100) {
money -= 100;
hundrede++;
continue;
}
if(money >= 50) {
money -= 50;
halvtreds++;
continue;
}
if(money >= 20) {
money -= 20;
tyve++;
continue;
}
if(money >= 10) {
money -= 10;
ti++;
continue;
}
if(money >= 5) {
money -= 5;
fem++;
continue;
}
if(money >= 2) {
money -= 2;
to++;
continue;
}
if(money >= 1) {
money -= 1;
en++;
continue;
}
cout << "You give this to the customer:" << endl;
cout << "5000:" << femtusind << endl;
cout << "2000:" << totusind << endl;
cout << "1000:" << tusind << endl;
cout << "500:" << femhundrede << endl;
cout << "200:" << tohundrede << endl;
cout << "100:" << hundrede << endl;
cout << "50:" << halvtreds << endl;
cout << "20:" << tyve << endl;
cout << "10:" << ti << endl;
cout << "5:" << fem << endl;
cout << "2:" << to << endl;
cout << "1:" << en << endl;
cout << "Want to quit? (yes = 1, no = 2)" << endl;
cin >> y;
} while(y != 1);
return 0;
}```
My error is:
LIBCD.lib(_flsbuf.obj) : fatal error LNK1190: invalid fixup found, type 0x000E

Btw. I know the program is a bit long, but it's made over danish kroners.

I would appreciate any help.

2. What compiler are you using? Everything that I've read from Google suggests that you need to try a clean rebuild.

3. I'm using Microsoft Visual Studio 98

4. First two things I noticed:

#include<iostream.h> is outdated, simply remove the .h

Second, you will have to put using namespace std; near the top as well (under include works fine) if you want to use cout without puting std before each one (same for cin)

Also, you may want to space your programs better and comment them. Makes them easier to read - making it easier to find bugs.

Your code seems a little wierd to me. I don't know whether it is cause I'm a newb or whether its because it actually is wierd

5. Thx for the answer Philandrew, it's the tag that makes my code a little wierd

I'll change that with the using namespace std. Damn. Wierd that I could forget it.