Saved Bookmarks
| 1. |
Write the output of the following codeint T = 9;for (int n = T; n> 6; n --){int V=T *n+n;System. out.println ("value = " + V);} |
|
Answer» See below. Explanation: The given code, int T = 9 ; for ( int n = T; n > 6 ; n -- ) { int V = T * n + n ; SYSTEM. out.println ("value = " + V); } Gives the output, value = 90 value = 80 value = 70 1. The initial value of T is 9. 2. Entering the for loop, the value of n is EQUAL to that of T which is 9. The value of n decreases till it is greater than 6. 3. The values of n will be - 9 , 8 , 7. 3. The values of V are - 90, 80, 70. These values will be the output. |
|