DSA quiz

DSA quiz

University

20 Qs

quiz-placeholder

Similar activities

TARANG Technical Quiz Round-2

TARANG Technical Quiz Round-2

University

20 Qs

CodeHS - Intro to Python - Basics and Console Interaction

CodeHS - Intro to Python - Basics and Console Interaction

9th Grade - Professional Development

20 Qs

coe java 24 june 21 7:30 to 745 pm only

coe java 24 june 21 7:30 to 745 pm only

University

20 Qs

Code-A-Vita

Code-A-Vita

University

20 Qs

CSE C Section

CSE C Section

University

20 Qs

C++ Procedurale Best of

C++ Procedurale Best of

University

18 Qs

C Programming 2

C Programming 2

University

25 Qs

Java Object Creation and Classes

Java Object Creation and Classes

University

20 Qs

DSA quiz

DSA quiz

Assessment

Quiz

Computers

University

Hard

Created by

JEYASARAVANAN JEYASARAVANAN

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int a = 5;

int b = a+++a;

printf("%d", b);

return 0;

}

What happens?

Prints 11

Prints 10

Compile error

Runtime error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <iostream>

using namespace std;

int main() {

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

cout << arr[3];

return 0;

}

What happens?

Prints 0

Undefined behavior (may print garbage)

Compile error

Prints 3

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

char str[5] = "Hello";

printf("%s", str);

return 0;

}

What happens?

Prints Hello

Compile error: string too long

Prints Hell

Runtime error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <iostream>

using namespace std;

int main() {

int *p = NULL;

cout << *p;

}

Prints 0

Prints garbage

Compile error

Runtime segmentation fault

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int x = 10;

printf("%d", ++x++);

return 0;

}

Prints 12

Compile error

Prints 11

Undefined behavior

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <iostream>

using namespace std;

int main() {

string s = "abc";

s[3] = 'd';

cout << s;

}

Prints abcd

Runtime error

Prints abc

Prints garbage

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int a = 5, b = 2;

printf("%d", a+++b);

return 0;

}

8

7

6

Compile 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?