Year-3

Year-3

University

25 Qs

quiz-placeholder

Similar activities

String in C Programming

String in C Programming

University

26 Qs

Arrays and pointers quiz

Arrays and pointers quiz

University

20 Qs

CCE-III Programming in C Language

CCE-III Programming in C Language

University

20 Qs

OOP - session 2.1 - JVM, Array, Stack

OOP - session 2.1 - JVM, Array, Stack

University

21 Qs

Zenorix 2023

Zenorix 2023

University

20 Qs

Programming skill

Programming skill

University

26 Qs

Test Your JavaScript Fundamental (Part 1)

Test Your JavaScript Fundamental (Part 1)

University

25 Qs

Arrays

Arrays

University

20 Qs

Year-3

Year-3

Assessment

Quiz

Computers

University

Hard

Created by

THEJASRINI 23ADR178

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

int arr[] = {1, 2, 3, 4, 5};

int *ptr = arr;

printf("%d", *(ptr + 3));

1

3

4

Compilation Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code snippet do?

int x = 5;

int *ptr = &x;

(*ptr)++;

printf("%d", x);

Increments the value of x by 1

Decrements the value of x by 1

Gives an error

Does nothing

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which sorting algorithm has the worst-case time complexity of ?

Merge Sort

Quick Sort

Bubble Sort

Heap Sort

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

void function(int arr[], int n) {

for (int i = 0; i < n; i++) {

arr[i] += 5;

}

}

int main() {

int arr[] = {1, 2, 3};

function(arr, 3);

printf("%d", arr[1]);

return 0;

}

2

7

3

Compilation Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about a struct in C?

Members of a struct are allocated contiguous memory by default.

Struct can contain only primitive types.

Struct members can be accessed using dot (.) and arrow (->) operators.

Struct can be used to implement inheritance.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for defining a template class in C++?

template<class T>

class template<T>

template<class>

template(T)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid feature in C++?

Friend Function

Operator Overloading

Multiple Inheritance

Garbage Collection

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?