Just a program here that subtracts a number from another number. I'm getting differences of -23882489428948248829...etc...can you tell why?
#include <stdio.h>
double minus(double a, double b) { // set up minus function
double difference = a - b;
return difference;
}
int main() //begin program
{
double a; //declare variables in this scope
double b;
printf("Enter the first number:\n");
scanf_s("%f", &a); //get a from user
printf("Enter the second number:\n");
scanf_s("%f", &b); //get b from user
printf("The difference is %f\n", minus(a,b)); //print results
return 0;
}