NEW
Font size
WorksheetsC Language Quiz
Total questions: 25
Worksheet time: 13mins
Who developed the C programming language?
Dennis Ritchie
Guido van Rossum
James Gosling
Bjarne Stroustrup
What is the primary purpose of the C language?
Data analysis
Game development
System programming
Web development
Which of the following is a valid header file in C?
string.hh
stdio.h
maths.h
iostream.h
What does the 'main()' function represent in a C program?
A function for input
The entry point of the program
A function for error handling
A function for output
What is the return type of the 'main()' function in C?
void
int
char
float
Which statement is used to print output in C?
echo()
print()
printf()
write()
What symbol is used to terminate a statement in C?
;
.
,
:
What does the return statement in the main function indicate?
The status of program termination
The start of the program
The end of the program
The number of errors
Which of the following is NOT a feature of C?
Object-oriented programming
Portability
Procedural programming
Low-level memory access
What is the purpose of header files in C?
To define the main function
To include function declarations
To manage memory
To store variables
Which of the following is a common application of C?
Web applications
Spreadsheet software
Mobile applications
Operating systems
What is the correct syntax for including a header file?
#include
#include [header.h]
#include header.h
#include {header.h}
What does 'malloc()' function do in C?
Reads input
Allocates memory
Prints output
Frees memory
Which of the following data types is NOT supported in C?
int
char
string
float
What operator is used to access members of a structure in C?
*
.
->
&
What is a string in C?
A special data type
A single character
An array of characters
No one
Which header file is required to use common string functions like strlen() and strcpy()?
stdlib.h
string.h
stdio.h
conio.h
What is the index of the first element in a C array?
1
0
-1
-2
Which of the following is the correct way to declare an integer array named numbers of size 5?
int numbers[5];
numbers int[5];
array numbers[5];
int array numbers[5];
What is the correct way to declare a float variable named temperature?
var temperature: float;
float temperature;
temperature float;
float variable temperature;
Which of the following is a valid way to comment in C?
// This is a comment
/* This is a comment */
Both of the above
None of the above
What is the purpose of the 'return' statement in a function?
To exit the function
To declare a variable
To print output
To return a value to the caller
Which of the following is the correct syntax for declaring a function that takes two integers as arguments and returns an integer?
function int myFunc(int a, int b);
int myFunc(int a, int b);
void myFunc(int a, int b);
myFunc(int a, int b) int;
In C, function parameters are always passed by __________.
reference
value
value-result
name
What is recursion in the context of C functions?
A function calling another function.
A function calling itself directly or indirectly.
A function that never terminates.
A function that does not take any arguments.
