This code i made, utilizing the type casting construct, isn't outputting what i wanted. The output for 'Dollars' and 'Cents' are returning '0' for both. instead all i want it to do is seperate the two. for example changing the float value of amount to an integer, giving a dollar value. Thanks.
Code:
#include <stdio.h>
int main()
{
double Amount;
int Dollars, Cents;
printf("Enter the Amount: ");
scanf("%e", &Amount);
Dollars = (int) Amount;
Cents = (int) ((Amount - Dollars)*100);
printf("%d\n", Dollars);
printf("%d\n", Cents);
return(0);
}