public class GuessNumber {
public static void main(String[] args) {
int a = 42;
int b = -7;
int c = a % b;
int d = b % a;
System.out.println(c + ", " + d);
}
}
Java Arithmetic Operations
Quiz
•
Computers
•
11th Grade
•
Hard
ANISA CUROVIC
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class GuessNumber {
public static void main(String[] args) {
int a = 42;
int b = -7;
int c = a % b;
int d = b % a;
System.out.println(c + ", " + d);
}
}
0,-6
0,6
-6,0
6,0
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class MyClass
{
public static void main(String s[])
{
int a = 34.0;
int b = 7;
int c = a % b;
System.out.println("c = " + c );
}
}
c = 4
The program does not compile
k = 6
k = 0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class BigNumbers {
public static void main(String[] args) {
System.out.println(10 * 5 + 100 * (25 * 11) / (25 * 10) * 10 - 5 + 7 % 2);
int zx = (10 * 5 + 100 * (25 * 11));
int yz = ((25 * 10) * 10 - 5 + 7 % 2);
System.out.println(zx / yz);
}
}
1046
1046
1046
10
1146
1146
1146
11
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Mods {
public static void main(String[] args) {
int x = 15;
int y = x % 4;
int z = y * 24;
System.out.println(z / 2);
}
}
84
36
2
3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Your code divides two integers: x = 55; y = 8. Which of the following will generate the real value (6.875)?
double z = x/y;
int z = double x / double y;
z = x/ double y
double z = ((double) x / (double) y)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Addition
{
public static void main(String s[])
{
int a = 4;
a -= 10;
a = -a;
a = 7 + a;
System.out.println(" a = " + a );
a %= a;
a = a * a - 3 ;
System.out.println(" a = " + a );
}
}
a = 13
a = -3
a = 33
a = 163
a = 33
a = 163
Program does not compile
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Relation {
public static void main(String args[]) {
int a = 10;
int b = 15;
a++;
b--;
int c = b % a;
System.out.println(c >= b);
}
}
true
false
Compilation Error
Runtime Error
15 questions
Progamming - Java Syntax
Quiz
•
11th - 12th Grade
15 questions
Basics in Java
Quiz
•
9th - 12th Grade
13 questions
Methoden in der Programmierung
Quiz
•
11th Grade
12 questions
Java
Quiz
•
11th Grade - University
10 questions
Pemrograman berorientasi objek
Quiz
•
11th Grade
10 questions
Quiz 15 - Array Basics
Quiz
•
11th Grade
10 questions
Introduction To Java: Hello World
Quiz
•
7th - 12th Grade
6 questions
Sains Komputer Tingkatan 4 - 1.3.5 Penggunaan Penyataan
Quiz
•
7th - 12th Grade
25 questions
Equations of Circles
Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)
Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System
Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers
Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)
Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade