Filters
Question type

Study Flashcards

Which of the following options defines an integer variable?


A) char age;
B) integer age;
C) int age;
D) age: int;

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet? Public static void main(String[] args) { System.out.print("Enter a number: ") ; Scanner in = new Scanner(System.in) ; String n1 = in.next() ; System.out.print("Enter another number: ") ; String n2 = in.next() ; String result = n1 + n2; System.out.print(result) ; }


A) 46
B) 4662
C) 107
D) 4562

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

What is the result of the following expression? Double d = 2.5 + 4 * -1.5 - (2.5 + 4) * -1.5;


A) 24.375
B) 6.25
C) 12.375
D) 6

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

Showing 101 - 103 of 103

Related Exams

Show Answer