If the txtPrice control contains the value 75, what value will the Decimal.TryParse (txtPrice.Text,decPrice) method return?

FALSE
TRUE
75
75

The correct answer is B. True.

The Decimal.TryParse method returns true if the string can be parsed successfully as a decimal number, and false otherwise. In this case, the string “75” can be parsed successfully as a decimal number, so the method will return true.

The other options are incorrect because:

  • Option A is incorrect because the method will return true, not false.
  • Option C is incorrect because the method returns a boolean value, not an integer value.
  • Option D is incorrect because the method returns a decimal value, not a double value.
Exit mobile version