Segmentation Fault (core dumped)
I am currently working on a simple program and was wondering how this segmentation fault is crashing my it. I can't find where exactly this error is taking place and any assistance would be appreciated.
Code:
#include <stdio.h>
int main()
{
float hw1,hw2,hw3,hw4;
float proj1,proj2,proj3;
float exam1,exam2,exam3;
float total,totalhw,totalproj,totalexam;
printf("Welcome to the CMSC104 grade calculation program. This program will calc\
ulate the final everage and course grade for a student in CMSC104.Each homework is\
worth 4%,each project is worth 8% and each exam worth 20%.\n");
printf("Enter the homework 1 score:\n");
scanf("%f",&hw1);
printf("Enter the homework 2 score:\n");
scanf("%f",&hw2);
printf("Enter the homework 3 score:\n");
scanf("%d",&hw3);
printf("Enter the homework 4 score:\n");
printf("Enter project 3 score;\n");
scanf("%f",&proj3);
printf("Enter exam 1 score:\n");
scanf("%f",&exam1);
printf("Enter exam 2 score:\n");
scanf("%f",&exam2);
printf("Enter exam 3 score:\n");
scanf("%f",&exam3);
}
if(total < 80)(total > 70){
printf("With an average of %f, your course grade is a C\n",total);
}
if(total < 70)(total > 60){
printf("With an average of %f,your course grade is a D\n",total);
}
if(total > 60){
printf("With an average of %f,your course grade is a F\n",total);
}
printf("Thank you for using the grade calculation program!");
return 0;
}