Here is your program with some printf statements that will output what troco is holding at each point in your program. Take a look at the values you are getting when you run it and see if you can figure anything out by this. This is called debugging, and as much as it can be a pain it will help you learn a lot.
Code:
#include <stdio.h>
#include <stdlib.h>
int main() {
float cafe=0.27, troco, d_int=2.00;
troco=d_int-cafe;
printf("Moedas do troco:\n");
while (troco > 0) {
if ((troco/2.00)>=1.00) {
printf("1x 2 euros\n");
printf("%d\n", troco);
troco-=2.00;
}
else if ((troco/1.00)>=1.00) {
printf("1x 1 euro\n");
printf("%d\n", troco);
troco-=1.00;
}
else if ((troco/0.50)>=1.00) {
printf("1x 50 cêntimos\n");
printf("%d\n", troco);
troco-=0.50;
}
else if ((troco/0.20)>=1.00) {
printf("1x 20 cêntimos\n");
printf("%d\n", troco);
troco-=0.20;
}
else if ((troco/0.10)>=1.00) {
printf("1x 10 cêntimos\n");
printf("%d\n", troco);
troco-=0.10;
}
else if ((troco/0.05)>=1.00) {
printf("1x 5 cêntimos\n");
printf("%d\n", troco);
troco-=0.05;
}
else if ((troco/0.02)>=1.00) {
printf("1x 2 cêntimos\n");
printf("%d\n", troco);
troco-=0.02;
}
else if ((troco/0.01)>=1.00) {
printf("1x 1 cêntimo\n");
printf("%d\n", troco);
troco-=0.01;
}
}
system("PAUSE");
return 0;
}