MCQOPTIONS
Bookmark
Saved Bookmarks
→
Java Programming
→
Exceptions
→
What would be the output of the following codesnip..
1.
What would be the output of the following codesnippet if variable p=20?
A.
10
B.
50
C.
15
D.
20
E.
30
Answer» D. 20
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
What is the valid data type for variable a to print Interview Mania ?<br><pre class="prettyprint lang-c"><br>switch(p)<br>{<br> System.out.println("Interview Mania");<br>}<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class jump_statment_Example<br> {<br> public static void main(String args[]) <br> { <br> int p = 4;<br> int q = 5;<br> for ( ; q < 10; ++q) <br> {<br> if (q % p == 0)<br> {<br> continue; <br> }<br> else if (q == 10)<br> {<br> break;<br> }<br> else<br> {<br> System.out.print(q + " ");<br> }<br> }<br> } <br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class selection_statement_Example<br> {<br> public static void main(String args[])<br> {<br> int num1 = 10; <br> int num2 = 20;<br> if ((num2 = 5) == num1)<br> {<br> System.out.print(num2);<br> }<br> else <br> {<br> System.out.print(++num2);<br> }<br> } <br> }<br></pre>
What would be the output of the following codesnippet if variable p=20?<br><pre class="prettyprint lang-c"><br>public class Result <br> {<br> public static void main(String args[]) <br> { <br> int p=20;<br> if(p<=0)<br> {<br> if(p==0)<br> {<br> System.out.println("5 ");<br> }<br> else <br> { <br> System.out.println("10 ");<br> }<br> }<br> System.out.println("15 ");<br> } <br> }<br></pre>
What is the valid data type for variable a to print Interview Mania ?
What would be the output of the following codesnippet if variable p=20?
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply