DSA quiz

DSA quiz

University

20 Qs

quiz-placeholder

Similar activities

GIT Básico

GIT Básico

University

18 Qs

data structures1

data structures1

University

20 Qs

Quiz on List and Tuples

Quiz on List and Tuples

University

16 Qs

Data Structure & Algo - Prelim Long Quiz

Data Structure & Algo - Prelim Long Quiz

University

21 Qs

GIT Workshop 2021

GIT Workshop 2021

University

20 Qs

Tema 1. Aseguramiento de la calidad

Tema 1. Aseguramiento de la calidad

University

15 Qs

Post Test ComputerProgramming

Post Test ComputerProgramming

University

20 Qs

Web Development and Programming

Web Development and Programming

University

20 Qs

DSA quiz

DSA quiz

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

JEYASARAVANAN JEYASARAVANAN

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

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?