N00b @ C: Code is failing at line 12 which is a basic scanf
Code:
#include <stdio.h>
#include <matlib.h>
#define YARDS_PER_HAT 220; YARDS_PER_SWEATER 460;
int main(void){
int yards_per_ball, num_balls;
int total_h, total_s;
printf("How many balls of yarn do you have?\n")
scanf("%d", &num_balls);
if (num_balls < 0)
printf("You are a liar! That's impossible. Restart the program and tell the truth.\n");
else
printf("How many yards are in each of your balls of yarn?\n");
scanf("%d" , &yards_per_ball);
if (num_balls < 0)
printf("You are a liar! That's impossible. Restart the program and tell the truth.\n");
total_h = yards_per_ball*num_balls/(YARDS_PER_HAT);
total_s = yards_per_ball*num_balls/(YARDS_PER_SWEATER);
printf("You can make %d hats or you can make %d sweaters.\n" , total_h; total_s);
getchar();
return 0
}