Thxs, the problem is that i run the program, Enter the note for example A and the program loops again and again asking for a new note, even after i enter 25 letters the program keeps looping asking for a letter and keeps printing the "else" part ("The note you entered is invalid")
ok ok, thanks a lot!! Aramil the program is almost almost almost! working, one of the problems was that damn C that was in upper case, but i have one last question.
The program itself is working but
-how do i avoid the duplication of the first printf (check picture in imageshack link)
-how i could tell the user an error saying the letter or number is invalid (in case he writtes any other letter or number) without using 1 cycle of the while loop
so first of all (and this isnt neccesarily wrong ive just never seen it) why are you scanning the adress? and then for the last else put in a thats an invalid grade and in the ifs i already covered that
ok the assigment is to writte a program using while function that counts how many people in a classroom of 25 persons got A, B, C, D or F,
Thats why im scanning the note if thats what u mean by address but like the forum says im a complete noob hahahaha...about the second part lets see if i got it right:
so the first part: the '&' is the address operator. what that means is that when a variable is declared it is stored in the ram. you can see exactly where it is stored in the ram by printing &nameOfTheVariable. It will change each time the program is run and if you dont know why look up ram. so you are scanning the adress of note. so im wondering why you do that and not just scanf("%c", note)? and you want 25 grades entered so what u did for the a do it for all other grades so that way the program wont end until 25 grades are entered regardless of any invalid grades entered
[edit]
so an if with no {} after it will only execute the statement immediately after it. however if you want to execute multiple statements wrap them with {}. look at my above post to see what i mean
ooo ok ok i made the corrections, and the program does end entering 25 grades but it doesnt say which are valid and which arent, if i enter an invalid number he just count them as zeros