
C Programming Quiz

Quiz
•
Professional Development
•
12th Grade
•
Hard
Shaik Imam
Used 22+ times
FREE Resource
32 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
}Which of the following is a correct way to concatenate two strings in C using macros?
#define CONCAT(a, b) a + b
#define CONCAT(a, b) a , b
#define CONCAT(a, b) a ## b
#define CONCAT(a, b) a || b
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What function is used to allocate memory dynamically in C?
malloc()
calloc()
realloc()
All of the above
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In dynamic memory allocation, what does the sizeof() operator determine?
Size of the allocated block
Size of the data type
Size of the pointer
Size of the structure
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you close a file in C after performing file operations?
fclose(file)
close(file)
closeFile(file)
file.close()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In C, the main function can take command line arguments. What is the prototype of such a main function?
int main(int argc , char *argv)
void main(int argc, char *argv[])
void main(char* args[])
int main(char* arguments)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the second command line argument in C?
argv[1]
argv[2]
argc[1]
args[2]
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the memset() function do in C?
Copies memory block
Moves memory block
Sets memory block with a constant value
Allocates memory block
Create a free account and access millions of resources
Similar Resources on Wayground
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Professional Development
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
29 questions
CCG 2.2.3 Area

Quiz
•
9th - 12th Grade
15 questions
PRESENTE CONTINUO

Quiz
•
9th - 12th Grade
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade
16 questions
AP Biology: Unit 1 Review (CED)

Quiz
•
9th - 12th Grade