

MCQOPTIONS
Saved Bookmarks
1. |
What would be the output of the following codesnippet if variable p=20?
public class Result { public static void main(String args[]) { int p=20; if(p<=0) { if(p==0) { System.out.println("5 "); } else { System.out.println("10 "); } } System.out.println("15 "); } } |
A. | 10 |
B. | 50 |
C. | 15 |
D. | 20 |
E. | 30 |
Answer» D. 20 | |