InterviewSolution
Saved Bookmarks
| 1. |
Given the following expressions : (a) val = 3 (b) val = = 3Answer the following questions.i. Are these two statements different ? If yes how? ii. What will be the result of the two elements if the value of val is 5 initially? |
|
Answer» (i) Yes, the two statements are totally different. The statement val = 3 is an assignment statement and the statement val = 3 is a relational expression which tests for equality. (ii) The result of (i) will be val having value 3 and the result of (ii) will be (0) false because 5 is not equal to 3. |
|