Important Questions [13]
- Define a class to overload the method perform as follows: ouble perform (doubler, double h)to calculate and return the value of Curved surface area of c)
- Give the Output of the Following Program Segment and Also Mention the Number of Times
- Write the Output: Charch= ‘F’; Int M= Ch; M=M+5; System.Out.Println(M+ ” ” +Ch);
- Convert Following Do-while Loop into for Loop. Int I = 1; Int D = 5; Do { D=D*2; System.Out.Println(D); I+ + ; } While (I< =5);
- 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”); }
- State the Difference Between While and Do While Loop.
- Convert the following while loop to the corresponding for loop: int m = 5, n = 10; while (n >= 1) { System.out.println(m*n); n--; }
- Analyze the Given Program Segment and Answer the Following Questions: (I) Write the Output of the Program Segment. (Ii) How Many Times Does the Body of the Loop Gets Executed?
- Give the output of the following program segment and also mention how many times the loop is executed : int i; for (i = 5; i > 10; i++) System.out.println(i); System.out.println(i * 4);
- What is an Infinite Loop ? Write an Infinite Loop Statement.
- Convert the following do...while loop to for loop: int x = - 10;do
- Give the Output of Following Code and Mention How Many Times the Loop Will Execute ?
- Give the output of the following program segment. How many times is the loop executed? for(x=10;x>20;x++) System.out.println(x); System.out.println(x*2);
