Subject:Computer SciencePrice: Bought3
Q.2.1 What does the following code output? System.out.println((5+20 + 5) * (10 / 10)) (2)
Q.2.2 What does the following code output? int c = 15; if(c>= 10 || c < 5){ System.out.println("aa"); System.out.println("bb"); } else{ System.out.print("bb"); System.out.print("aa"); } (2) Q.2.3 What does the following code output? System.out.println((5+20) * 2 + 10); (2)
Q.2.4 What does the following code output? int a = 25; if(a>= 25 && a < 5){ System.out.println("aaa"); System.out.println("bbb"); } else{ System.out.println("yyy"); System.out.println("zzz"); (2)
Q.2.5 What does the following code output? if((5 == 5) || (3 != 2) && ((10 + 1)==11)){ System.out.println(true); } else{ System.out.println(true); } (2)
Q.2.6 What does the following code output? System.out.println((5+25 + 5) * (8 / 8) + (1+1)); (2)
Q.2.7 What does the following code output? System.out.println(((5 * 3) + 5 + (2 % 2))/2);
Q.2.8 What does the following code output? System.out.println((5+15 + 5) * (3 / 3) + (10+1)); (2)
Q.2.9 Assuming a variable of x has been assigned the value 10, the value of !(x <= 10) would be _________? (2)
Q.2.10 What does the following code output? boolean p; int q = 5; System.out.println(p = !(q == 2))