InterviewSolution
Saved Bookmarks
| 1. |
what is the output of the following program segment ? 10 A = 10 20 C = A^ 2 30 PRINT C (a) 2 (b) 100 (c) 20 |
|
Answer» = A**2print(C)The required answer is (b) 100.You've started by storing the value 10 in variable A. You then CREATE another value for C [A**2].[Note that ** indicates exponentiation]10² is 100 This value is stored in C.You then ask to PRINT the value of C which is option (b) 100.The print statement is usually used to send the required output of the expression given. However, if no values is inputted, it will result in a BLANK LINE. |
|