C-Volution (Intermediate)

C-Volution (Intermediate)

University

20 Qs

quiz-placeholder

Similar activities

2F-3 | Python Quiz | 14/11/2024

2F-3 | Python Quiz | 14/11/2024

University

20 Qs

Session 03: Input & Output in C Programming Language

Session 03: Input & Output in C Programming Language

University

15 Qs

Итоговый тест по С

Итоговый тест по С

University

20 Qs

Minigame CLB Tin học 20/10

Minigame CLB Tin học 20/10

University

15 Qs

BYTS ASSESSMENT

BYTS ASSESSMENT

University

15 Qs

Demo loop

Demo loop

University

19 Qs

Вопросы по алгоритмам и программированию

Вопросы по алгоритмам и программированию

University

20 Qs

IT/CS Review Quizzizz

IT/CS Review Quizzizz

6th Grade - University

15 Qs

C-Volution (Intermediate)

C-Volution (Intermediate)

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Sujal Bhagat

Used 1+ times

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?