If you pass the test, then you’ll get an A for the course.
You didn’t get an A for this course.
Therefore you didn’t pass the test.

In this argument, we are ______ the consequent.

We are DENYING the consequent.

We are dealing here with a Conditional (If X then Y: expressed in symbolic logic as X–>Y).

X is the ANTECEDENT, Y is the CONSEQUENT.

Conditionals yield 4 arguments in classical logic, two valid and 2 invalid (fallacies):

1. AFFIRMING the ANTECEDENT.
X–>Y
X is the case
Hence Y is the case
Valid

2. AFFIRMING the CONSEQUENT.
X–>Y.
Y is the case
Hence X is the case
Invalid (Fallacy of Affirming the Consequent)

3. DENYING the ANTECEDENT
X–>Y
X is not the case
Hence Y is not the case
Invalid (Fallacy of Denying the Antecedent)

4. DENYING the CONSEQUENT
X–>Y
Y is not the case
Hence X is not the case
Valid

Running through each using your example.

1. You pass the test, so, as the conditional says, you’ll get an A.

2. You get an A, but this could be due to other good results even though you failed the test, so it doesn’t follow you passed the test. There are other ways of getting an A, passing the test is just one of them.

3. Same as 2. You fail the test. Fine, there are other ways to get an A.

4. Same as 1. If you pass the test you get an A. But you haven’t got an A. So you can’t have passed the test.

The Principle that Denying the Consequent entails Denying the Antecedent (your example, and 4. above) has the Latin name ‘Modus Tollens’ meaning ‘Way that Denies’.

The Principle that Affirming the Antecedent entails Affirming the Consequent (1. above) has the Latin name ‘Modus Ponens’ meaning ‘Way that Affirms’.

These Principles were, I think, first explicitly stated by the Stoics.