Search Header Logo

coding 1

Authored by svh almas

Computers

University

Used 1+ times

coding 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: What is the output of the following code snippet?

    int a = 5, b = 10;

    int result = a & b;

    printf("%d", result);

a) 0

b) 5

c) 10

d) 15

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: Which of the following operators is used for floor division in Python?

a) /

b) //

c) %

c) %

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: What is the output of the following code snippet?

    int a = 10; int b = 20; int result = a + b * 2; System.out.println(result);

a) 60

b) 50

c) 30

d) 40

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: What is the difference between a++ and ++a?

a) No difference

b) a++ increments a by 2, ++a increments a by 1

c) a++ returns the current value and then increments, whereas ++a increments first and then returns the new value.

d) Both decrement a

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: What will be the output of the following code snippet?

    int a = 5;

    int b = ++a * 2;

    printf("%d\n", b);

a) 10

b) 12

c) 8

d) 6

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: What is the result of 5 | 3 in binary?

A) 101

B) 110

C) 111

D) 100

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Question: Which of the following statements about the modulo operator (%) is true?

A) It returns the quotient of a division operation.

B) It returns the remainder of a division operation.

C) It returns the product of a multiplication operation.

D) It returns the result of a subtraction operation.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers