Ask Question
15 March, 12:53

Given two Generic variables, A with value "123" and B with value 456, what would the Write Line output of A + B be? 123456 579 An exception will be thrown. 123 + 456

+1
Answers (1)
  1. 15 March, 13:26
    0
    123456

    Explanation:

    When an integer value is added to a string value the resulting value is a string. + operator is used for both numeric additions and string addition also knows as string concatenation. In addition when one operand of the equation is a string the program interprets all values as string. As system is interpreting all values as a string it will apply a string addition method instead of mathematical addition. So here A is a string and B is an integer value. when we add A and B system will treat B aslo as a string, upon addition the result will be String concatenating both A and B to a single string. Hence the result of A+B will be

    A+B = 123456

    As WriteLine method takes string as Input it will just write the resulting string to file
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given two Generic variables, A with value "123" and B with value 456, what would the Write Line output of A + B be? 123456 579 An exception ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers