
Mastering C Programming Concepts

Quiz
•
Other
•
University
•
Hard
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
Similar Resources on Wayground
15 questions
Introduction to Computer organisation

Quiz
•
University
10 questions
DCMC Surprise Quiz

Quiz
•
University
15 questions
OS QUIZ

Quiz
•
University
15 questions
Quiz 1 - OPERATING SYSTEM

Quiz
•
University
11 questions
Electronics

Quiz
•
University
15 questions
Memory Management Quiz B

Quiz
•
University
10 questions
Module 2 Quiz

Quiz
•
University
15 questions
Data Structure & Algorithm

Quiz
•
University
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade