InterviewSolution
Saved Bookmarks
| 1. |
Give the output of the following code:String A = “26”, B=”100″; String D =A+B+”200″; int x = Integer.parselnt(A); int y = Integer.parselnt(B); int d = x+y; System.out.println(“Result 1 = ”+D); System.out.prinln(“Result 2 = “+d); ,(i) Analyze the given program segment and answer the following questions : for(int i=3;i< =4;i+ +) { for(int j=2;j<i;j + + {System.out.print(” “); } System.out.println(“WIN”); }(i) How many times does the inner loop execute ? (ii) Write the output of the program segment. |
|
Answer» Result 1 = 26100200 Result 2 = 126 (i) Once (ii) WIN WIN |
|