#include<stdio.h>
int main(void)
{
//declare and initialize variables.//
double dollars = 0;
double exchange_rate = 0;
double shekels = 0;
//get input from user.//
scanf("%f %f", &dollars, &exchange_rate);
// calculate sum.//
shekels = exchange_rate * dollars;
// print result.//
printf("%f", shekels);
return 0;
}
I keep getting zeros no matter what two numbers I put in . It always has been the case for me when using doubles so I want to understand what I'm doing wrong here. When can I use double and how can I use it?