Java Arithmetic Operations

Java Arithmetic Operations

11th Grade

10 Qs

quiz-placeholder

Similar activities

Traversing Arrays

Traversing Arrays

10th - 12th Grade

14 Qs

Java Arrays Basic

Java Arrays Basic

10th - 12th Grade

15 Qs

JAVA: Level-1

JAVA: Level-1

5th - 12th Grade

15 Qs

Search for Content on Methods in Java

Search for Content on Methods in Java

11th - 12th Grade

10 Qs

Java Array Basics

Java Array Basics

10th - 12th Grade

15 Qs

Break the fear

Break the fear

11th - 12th Grade

10 Qs

AP CSA Arrays

AP CSA Arrays

10th - 12th Grade

14 Qs

Exploring Computer Science

Exploring Computer Science

10th - 12th Grade

14 Qs

Java Arithmetic Operations

Java Arithmetic Operations

Assessment

Quiz

Computers

11th Grade

Hard

Created by

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?