Strictly speaking, this is a compiler warning (not an error). It’s technically “legal” to have variables you don’t actually use, but the compiler’s telling you that it’s probably a mistake. In this case, as others have indicated, you assign a value to amount
but you never actually do anything with it.
As a general tip, it’s helpful to pay close attention to the text of the warning – in this case, it was what it said (you don’t do anything with the amount
variable). Eric Lippert has an extremely helpful article available on how to debug small programs that I recommend taking a look at when you get a chance. (His explanation of “rubber-duck debugging” alone makes the article more than worth the read).
solved Compound Interest Program Syntax Error