[Solved] C Program for reading test results [closed]


When using if statements and you want to compare a result you should use == instead of =.
With = you are assigning a value to a variable and == compares between to values.

You can also not compare two things at the same time like:

if (result = 70<=100)

You need to check if result <= 100 AND result >= 70

To make multiple checks in an if statement you need to use && (AND) or || (OR)

In your case you should use:

if(result <= 100 && result >= 70)

See:

http://www.c4learn.com/c-programming/c-logical-operator/

http://www.tutorialspoint.com/cprogramming/if_else_statement_in_c.htm

1

solved C Program for reading test results [closed]