C-Volution (Intermediate)

C-Volution (Intermediate)

University

20 Qs

quiz-placeholder

Similar activities

Usable Encryption Quiz

Usable Encryption Quiz

University

20 Qs

OSS (QUIZ 8) Security and Protection

OSS (QUIZ 8) Security and Protection

University

15 Qs

NET102:  Quiz No. 1

NET102: Quiz No. 1

University

20 Qs

IT for Managers M1

IT for Managers M1

University

20 Qs

Cloud Service Models & Software Process Models

Cloud Service Models & Software Process Models

2nd Grade - University

20 Qs

Microsoft Word 2019 Advanced – Unit 1 (Review of Basic Concepts)

Microsoft Word 2019 Advanced – Unit 1 (Review of Basic Concepts)

10th Grade - University

15 Qs

Theory Test 2 - Network & Data Communication

Theory Test 2 - Network & Data Communication

University

19 Qs

ISP and Data Packets Part 2

ISP and Data Packets Part 2

University

15 Qs

C-Volution (Intermediate)

C-Volution (Intermediate)

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Hard

Created by

Sujal Bhagat

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

45 sec • 2 pts

What is the output of the following code #include int main() { int x = 5; int *p = &x; *p = *p + 10; printf("%d\n", x); return 0; }

5

10

15

Error

2.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Which of the following is NOT a valid way to dynamically allocate memory?

malloc()

calloc()

realloc()

alloc()

3.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What is the primary difference between malloc() and calloc()?

malloc() initializes allocated memory to zero, calloc() does not.

calloc() allocates memory for a single element, malloc() for multiple.

malloc() allocates memory in bytes, calloc() in number of elements.

There is no difference.

4.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What is a dangling pointer?

A pointer that points to a memory location that has been freed.

A pointer that has not been initialized.

A pointer that points to a null value.

A pointer that points to an invalid memory address.

5.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What is the output of the following code? #include int main() { char str[] = "Hello"; printf("%lu\n", sizeof(str)); return 0; }

5

6

7

Error

6.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Which of the following is the correct way to declare a function pointer?

int (*func)(int, int);

int *func(int, int);

int func(int, int);

int *(func)(int, int);

7.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What does the const keyword signify when used with a pointer?

The pointer cannot be changed.

The value pointed to by the pointer cannot be changed.

Both the pointer and the value pointed to cannot be changed.

It has no effect.

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?