Search Header Logo

C and Java Programming Quiz

Authored by Gagan S K

Computers

University

C and Java Programming Quiz
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

Media Image

What is the output of the following program?

30 10

30 20

20 10

40 20

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is wrong with the following stack implementation?

Incorrect condition for stack overflow

Incorrect indexing for the stack

No error, the code works correctly

Stack is initialized incorrectly

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data structures is best suited for finding the median in a stream of numbers?

Array

Doubly Linked List

Heap

Binary Search Tree

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Find the error in the following circular queue implementation:

Incorrect modulo operation

Overwriting of the first element during enqueue

Incorrect check for queue full

Logic for incrementing rear is incorrect

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The time complexity of deleting a node in a doubly linked list with n nodes, given a pointer to the node, is:

O(1)

O(n)

O(log n)

O(n log n)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the following code output?

10

20

Compile-time error

Runtime error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the issue with the following Java snippet?

Misuse of this keyword

Incorrect variable declaration

No error

Incorrect access modifier for x

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