DSA quiz

DSA quiz

University

20 Qs

quiz-placeholder

Similar activities

แบบทดสอบเรื่อง if การเขียนโปรแกรม C++

แบบทดสอบเรื่อง if การเขียนโปรแกรม C++

University

20 Qs

Terminos ITGS x

Terminos ITGS x

8th Grade - University

20 Qs

WEEK1 TUTO 3

WEEK1 TUTO 3

University

17 Qs

C Quest 2.0

C Quest 2.0

University

20 Qs

IT (data, viruses and more)

IT (data, viruses and more)

8th Grade - Professional Development

20 Qs

DataQuest_Quiz

DataQuest_Quiz

University

15 Qs

PHP First Internal Practical Viva

PHP First Internal Practical Viva

University

20 Qs

Quiz sobre Estructuras Selectivas en Java

Quiz sobre Estructuras Selectivas en Java

12th Grade - University

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