We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
IT232 Quiz - Questions and Answers: 11/2/2024
Question Number Question Answer
1. How does an encoder differ from a An encoder converts decoder? more inputs to fewer outputs 2. What is the final step in the design of a Verify the correctness combinational circuit? of the design 3. What is the purpose of obtaining To minimize the simplified Boolean functions in the complexity of the logic design process? diagram 4. What is the output of the following 54321 Java code? int x = 5; while (x > 0) { System.out.print(x + " "); x--; } 5. Which logical operator is used in Java && (AND) to ensure both conditions in an expression are true? 6. Conversion and Coding are two names False of exactly the same process. 7. What is the output of the following 10 code?
public class Main {
public static void main (String[] args) {
int a = 2;
System.out.println(a*=5);
} }
8. What does a nested loop refer to in loop inside another
programming? loop.
9. Which of the following statements is It tests the loop
true about the 'while' loop in Java? condition before executing the loop body. 10. What is the output of the following 10 and 10.0 code? class Test { static int add(int a, int b) { return a + b; } static double add (double a, double b) { return a + b; } public static void main(String[] args) { System.out.printin(add(5, 5)); System.out.println(add(5.0, 5.0)); } }
11. Which keyword is used to include a import
package in a Java program? 12. tests the loop continuation condition do…while after executing the loop's body. 13. Which method is used to print text in println() Java? 14. What is the output of the following 6 code? public class Main { public static void main(String[] args) { int a = 2, b = 4; System.out.println(a+b); } } 15. In Java, which escape sequence is used \n to start a new line? 16. Which logical operator is used in Java && (AND) to ensure both conditions in an expression are true? 17. Which method signature would match static double add (int a, a call to add(10, 15.5) in a class where double b) method overloading is used? 18. Which method is used to print text in println() Java? 19. Which of the following is correct System.out.print("Hello syntax for printing formatted text %s", "World"); using printf? 20. In method overloading, what must be The number and/or different for each method? type of parameters 21. Which is true about while loop. The program tests the loop-continuation condition at the beginning of the loop. 22. Which method is used to obtain user Scanner input in Java? 23. What does the %d format specifier Decimal integer represent in printf? 24. What is the purpose of comments in To provide Java code? documentation and improve code readability 25. What will be the output of the 012 following code?
for (int i = 0; i < 5; i++) {
if (i == 3) { break; } System.out.print(i + " *); }
26. Which of the following is a java To group related
keyword? classes and allow code reuse 27. What is the output of the following 19 code? public class Main { public static void main(String[] args) { int x =3; x*=6; x+=2; --X; System.out.println(x); } }