There are many ways to express agreement or disagreement. There are special words/expressions that clearly indicate the intention and their appropriateness to the situation. These words/expressions can be formal or informal.
Example: Of course, I agree, No, seriously, I believe otherwise