C-Volution (Intermediate)

C-Volution (Intermediate)

University

20 Qs

quiz-placeholder

Similar activities

Recap Handout 3 & 4

Recap Handout 3 & 4

6th Grade - University

15 Qs

Quiz #2

Quiz #2

University

15 Qs

Table,Image formatting

Table,Image formatting

5th Grade - University

15 Qs

Fundamentos de Bases de Datos

Fundamentos de Bases de Datos

10th Grade - University

15 Qs

Cyber Offences Quiz

Cyber Offences Quiz

University

20 Qs

LONG QUIZ MIS

LONG QUIZ MIS

University

20 Qs

Exploring Drone Technology in Career Clusters

Exploring Drone Technology in Career Clusters

10th Grade - University

15 Qs

Database quiz part 1 - D2T4

Database quiz part 1 - D2T4

University

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