I'm trying to write a program to tell you your grade depending on the numerical value that is put in and I don't know what I am doing wrong. when I put in the numerical value all it does is close the program. This is my last resort. Please Help
#include <stdio.h>
int main(void)
{
int numbergrade;
int a;
int b;
int c;
int d;
int f;
You are only asking for input when you call scanf(), so you should probably use that before you actually try to check what numbergrade is.
Also, what is the point of all the a~f variables? I'd have thought you were going to output what the user's grade was, not declare several integers that happen to share the names with the grades you are looking for.
I was using scanf like that in terms of when it gets to the specific requirement it will stop and spit out the letter grade.
I was actually trying to give each set of numbers it's specific grade.
Was that an issue?
I'm just stating and it is really confusing for me I honestly don't know what I'm doing wrong and posting here was truly my last resort
If you want to print out the letter 'A', for example, you don't need to declare a variable for that. Just print it out like you did the text asking the user for their input.
You will also want to have a scanf() statement to read in the numerical grade.
Probably the main issue is that you are trying to check the value of numbergrade when it has not been initialized anywhere.
I don't think you are understanding what I am saying; please re-read my previous posts and make sure you understand exactly what the problem I am identifying is. Just randomly making changes that sound like what I was mentioning will not help you.