You're supposed to write a function to go along with that function prototype.
In that case, it will return an int and you should print it with "%d".
Actually, the function prototype looks wrong since it's supposed to take in the dollar_amount and return the cents.
Presumably it should be:
Code:
int compute_cents(double dollar_amount);
Then the function would look something like this:
Code:
int compute_cents(double dollar_amount) {
int cents;
// compute the cents (as an int) here
return cents;
}
And your main would be something like:
Code:
int main(void)
{
double dollar_amount;
int cents;
printf("Enter dollar amount");
scanf_s("%lf", &dollar_amount);
cents = compute_cents(dollar_amount);
printf("Cents: %d\n", cents);
return 0;
}