Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Practicing Return Values | Methods
C# Basics
course content

Contenido del Curso

C# Basics

Practicing Return Values

Here operate is a method which is supposed to return true if a + b equals c. Fill in the blank to make the method behave accordingly.

cs

main

  1. We can write expressions directly in the return statement.
  2. For-example, writing return a + b; is valid as it will first evaluate a + b and in-turn return the resultant value. Similarly, we can also directly write boolean expressions in the return values, as boolean expressions are expressions after all. Hence, writing return a > b; is also valid. Using this information, think of a way how you can write a boolean expression that returns true if the sum of a and b is greater than c.
cs

main

¿Todo estuvo claro?

Sección 6. Capítulo 7
We're sorry to hear that something went wrong. What happened?
some-alt