First, let me start by saying this is not a homework or school assignment. I am attempting to learn C on my own, by myself, and have purchased some books on the subject, including C- How to Program 8th Ed. and C Programming Absolute Beginners Guide. I have also watched through the first 15 videos by "thenewboston" on youtube to get a further understanding of what I am reading. So far, I am comfortable with headers, operators, variables, scanf, and printf functions and was attempting to put all the learning together to come up with a simple bills payment calculation. My compiler, (CodeBlocks), doesn't throw any compile errors but upon execution the program has a fatal error after the last scanf it seems. I have looked at things over and over and searched through my books but I can't detect the problem. I have tried using integers instead of floats and that didn't correct either. Any assistance would be greatly appreciated. It could be something very simple but I deleted all code and tried again in an attempt to minimize any small rookie errors but still can't get it to run to completion. Thanks!
Code Below:
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
float paycheck, bill1, bill2, savings, spending;
char bill_1[20];
char bill_2[20];
printf("How much did you get paid this week?\n");
scanf("%f", &paycheck);
printf("What is your first bill to pay this week?\n");
scanf("%s", &bill_1);
printf("How much is that bill in dollars?\n");
scanf("%f", &bill1);
printf("What is your second bill to pay this week?\n");
scanf("%s", &bill_2);
printf("How much is that bill in dollars?\n");
scanf("%f", bill2);
savings = (paycheck - (bill1 + bill2)) * .15;
spending = paycheck - (bill1 + bill2) - savings;
printf("You will pay a total of %.2f in bills, paying %s and %s, save %.2f dollars, and then have %.2f dollars to spend.", bill1+bill2, bill_1, bill_2, savings, spending);
return 0;
}