Mastering C Programming Concepts

Mastering C Programming Concepts

University

10 Qs

quiz-placeholder

Similar activities

Data Structure & Algorithm

Data Structure & Algorithm

University

15 Qs

Operating Systems Quiz 2

Operating Systems Quiz 2

University

15 Qs

DYRT  Ch 10

DYRT Ch 10

University

10 Qs

EC8552_CA0_MODEL EXAM I_PART B_16.10.2020

EC8552_CA0_MODEL EXAM I_PART B_16.10.2020

University

10 Qs

Computer1

Computer1

1st Grade - Professional Development

10 Qs

IOT UsingTI CC 3200 Unit 3-5

IOT UsingTI CC 3200 Unit 3-5

University

10 Qs

HEAP MEMORY MANAGEMENT RTOS

HEAP MEMORY MANAGEMENT RTOS

University

10 Qs

Exploring C++, Data Structures, and HTML

Exploring C++, Data Structures, and HTML

12th Grade - University

10 Qs

Mastering C Programming Concepts

Mastering C Programming Concepts

Assessment

Quiz

Other

University

Hard

Created by

Ramya A

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a pointer in C and how is it used?

A pointer in C is a special data type that can only hold integer values.

A pointer in C is a type of function that returns a value.

A pointer in C is a variable that holds the address of another variable, enabling direct memory access and manipulation.

A pointer in C is a variable that stores a string of characters.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between stack and heap memory.

Stack memory is for static allocation and is faster; heap memory is for dynamic allocation and is larger but slower.

Stack memory is larger and slower; heap memory is for static allocation and is faster.

Heap memory is for static allocation and is smaller; stack memory is for dynamic allocation and is slower.

Stack memory is for dynamic allocation and is larger; heap memory is for static allocation and is faster.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the common data structures available in C?

Arrays, linked lists, stacks, queues, trees, hash tables

Strings, files, objects, enums

Dictionaries, lists, arrays, classes

Graphs, matrices, sets, tuples

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you open and close a file in C?

Use fopen() to open a file and fclose() to close it.

Use read() to open a file and write() to close it.

Use open() to open a file and close() to close it.

Call openFile() to open a file and closeFile() to close it.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is dynamic memory allocation and how is it done in C?

Dynamic memory allocation is done using static arrays.

Dynamic memory allocation in C is done using functions like malloc(), calloc(), realloc(), and free() to manage memory at runtime.

Dynamic memory allocation is managed using global variables.

Memory allocation in C is only possible at compile time.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Describe how to handle errors in C using errno.

Check the return value of every function without using errno.

Use the 'error' function to handle errors in C.

Use the global variable 'errno' to check for errors after function calls in C.

Ignore errors and continue execution without any checks.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'malloc' function in C?

To free up memory used by the program.

To allocate memory for global variables.

To initialize static memory at compile time.

To allocate dynamic memory on the heap.

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?

Discover more resources for Other