
C Programming Challenge

Quiz
•
English
•
12th Grade
•
Medium
Rahul undefined
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax to declare a pointer in C?
int *ptr;
char *ptr;
double *ptr;
void *ptr;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the difference between 'malloc' and 'calloc' functions in C.
malloc allocates uninitialized memory block, calloc allocates initialized memory block with all bits set to zero
malloc allocates memory in stack, calloc allocates memory in heap
malloc is used for allocating memory for arrays, calloc is used for allocating memory for variables
malloc and calloc are interchangeable functions in C
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you pass arguments by reference in C?
Pass the address of the variable as an argument to the function and dereference the pointer inside the function to access and modify the original variable.
Pass the value of the variable as an argument to the function
Use a global variable to pass arguments by reference
Pass a copy of the variable to the function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the 'sizeof' operator in C?
To calculate the square root of a number
To convert a variable to a different data type
To determine the size in bytes of a data type or a variable.
To check if a variable is initialized
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the difference between 'while' and 'do-while' loops in C.
Both 'while' and 'do-while' loops have the same behavior
In 'while' loop, the condition is checked after executing the block of code
In 'while' loop, the condition is checked before executing the block of code, whereas in 'do-while' loop, the block of code is executed at least once before checking the condition.
In 'do-while' loop, the block of code is executed only if the condition is true
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the 'switch' statement used for in C?
It is used for creating loops in C.
It is used for defining variables in C.
It is used for multi-way branching based on the value of a variable or expression.
It is used for handling exceptions in C.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you dynamically allocate memory in C?
pointer_variable = (cast-type*) calloc(size);
pointer_variable = (cast-type*) malloc(size);
pointer_variable = (cast-type*) free(size);
pointer_variable = (cast-type*) realloc(size);
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Linear Cost Equations: Identify Variables & Constants

Quiz
•
8th Grade - University
15 questions
Extended Response

Quiz
•
8th Grade - University
20 questions
Morphology

Quiz
•
7th - 12th Grade
10 questions
Exploring Relationships: Identifying Math Variables in Grade 4

Quiz
•
4th Grade - University
10 questions
Solving Word Problems: Variables, Constants & Equations

Quiz
•
8th Grade - University
15 questions
Quiz on Economics as a Social Science

Quiz
•
12th Grade - University
14 questions
Repetytorium MacMillan - Houses: vocab + matura tasks

Quiz
•
12th Grade
10 questions
Structure - GCSE English

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for English
6 questions
Biography

Quiz
•
4th - 12th Grade
7 questions
Parts of Speech

Lesson
•
1st - 12th Grade
12 questions
Red Velvet Brick 09/25

Lesson
•
9th - 12th Grade
5 questions
Transition Words

Quiz
•
8th - 12th Grade
20 questions
Literary Elements

Quiz
•
9th - 12th Grade
22 questions
Epic Heroes and Their Values

Quiz
•
12th Grade
8 questions
Subject-Verb Agreement Exercises

Quiz
•
9th - 12th Grade
84 questions
Greek and Latin Root Words - Common 84

Quiz
•
9th - 12th Grade