I have written the following code and when I try to run it, I get the following warnings:
- warning: variable 'money' is uninitialized when used here [-Wuninitialized] GetData (money, product); 
- note: initialize the variable 'money' to silence this warning int product, money, change; 
- warning: variable 'product' is uninitialized when used here [-Wuninitialized] GetData (money, product); 
- note: initialize the variable 'product' to silence this warning int product, money, change; 
- warning: variable 'change' is uninitialized when used here [-Wuninitialized] CalculateChange (money, product, change); 
- note: initialize the variable 'change' to silence this warning int product, money, change; 
I have also typed an arrow to the relevant line. I have been trying to figure out how to fix this problem for an hour now. If you could please help, it would be much appreciated.
#include <stdio.h>
#include <ctype.h>
void GetData (int money, int product)
{
  // Asks user how much was the product and how much they paid the cashier. //
  printf("\nHow much was the product?\n");
  scanf("%d", &product);
  if((product < 5) || (product > 95) || (product %5 != 0))
  printf("\nInvalid number!\nNumber has to be a multiple of 5 and cannot be less than 5 or 
  more than 95.\n");
  else printf("How much did you give to the cashier? \n");
  scanf("%d", &money);
  if (money < product)
  printf("You did not give enough money to the cashier!");
  return;
}
void CalculateChange (int money, int product, int change)
{
  // Calculates the amount of change needed. //
  int fifty = 0;
  int twenty = 0;
  int ten = 0;
  int five = 0;
  change = (money - product);
  fifty += change / 50;
  change %= 50;
  twenty += change / 20;
  change %= 20;
  ten += change / 10;
  change %= 10;
  five += change / 5;
  change %= 5;
  return;
}
void PrintResults (int fifty, int twenty, int ten, int five)
{
  // Prints the amount of coins needed. //
  printf("\nThe number of fifty cents: %d", fifty);
  printf("\nThe number of twenty cents: %d", twenty);
  printf("\nThe number of ten cents: %d", ten);
  printf("\nThe number of five cents: %d", five);
return;
}
int main ()
{
  int product, money, change; <------
  int fifty = 0;
  int twenty = 0;
  int ten = 0;
  int five = 0;
  char response;
do {
  GetData (money, product); <-------
  CalculateChange (money, product, change);
  PrintResults (fifty, twenty, ten, five);
  printf("\nWould like to quit the program? Enter y or n\n");
  scanf("%c", &response );
  response = tolower (response);
  printf("--------------------------------------------------------------------------");
} while (response != 'y');
  printf("\nQuitting program...\n");
  return (0);
}
 
     
     
    