
C Programming Challenge
Quiz
•
English
•
12th Grade
•
Practice Problem
•
Medium
Rahul undefined
Used 1+ times
FREE Resource
Enhance your content in a minute
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);
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
14 questions
General knowledge
Quiz
•
2nd - 12th Grade
20 questions
mu như cc
Quiz
•
12th Grade
10 questions
Pronunciation of "ed"
Quiz
•
12th Grade
20 questions
Grade 3 Unit 3 Read and Think 1&2 Animals on the Red List
Quiz
•
8th Grade - University
12 questions
ANH10-GK2-2324-STRESS
Quiz
•
9th - 12th Grade
20 questions
Australia
Quiz
•
9th - 12th Grade
20 questions
Past simple and past continuous
Quiz
•
7th - 12th Grade
10 questions
Either-Neither
Quiz
•
6th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for English
20 questions
Parts of Speech
Quiz
•
12th Grade
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
8 questions
Harrison Bergeron Intro
Quiz
•
9th - 12th Grade
20 questions
Grammar
Quiz
•
9th - 12th Grade
20 questions
Text Structures
Quiz
•
9th - 12th Grade
20 questions
Poetry Terms
Quiz
•
9th - 12th Grade
20 questions
Figurative Language
Quiz
•
9th - 12th Grade
