NEW
Font size
WorksheetsC Programming Quiz
Total questions: 19
Worksheet time: 10mins
Who developed the C programming language?
James Gosling
Dennis M Ritchie
Bjarne Stroustrup
Ken Thompson
In which year was the C programming language first introduced?
1990
1980
1972
1967
What is the main function in a C program?
The function that handles input
The function that outputs results
The function where execution starts
The function that performs calculations
Which of the following is a valid identifier in C?
float
variable-name
1stVariable
_variable
What does the 'printf' function do in C?
Reads user input
Prints formatted output
Declares variables
Defines functions
Which of the following is NOT a basic data type in C?
char
string
float
int
What is the size of an 'int' data type in C?
4 bytes
2 or 4 bytes
1 byte
8 bytes
Which of the following is a keyword in C?
function
if
variable
array
What is the purpose of the 'scanf' function?
To define functions
To declare variables
To read user input
To print output to the console
What is a constant in C?
A variable that can change
A fixed value that does not change
A function that returns a value
A data type
Which of the following is an example of a real constant?
0
'A'
3.14
10
What is the output of the following code: printf("%d", 5);?
None of the above
5
5.0
Error
What is the purpose of the body of a C program?
To perform tasks and operations
To declare functions
To include libraries
To execute the main function
Which of the following is a feature of C programming?
Declarative
Functional
Procedural
Object-oriented
What does the term 'portable' mean in the context of C programming?
Code is secure
Code is easy to write
Code can be transferred between machines
Code can be easily read
What is the role of header files in C?
To execute the program
To define variables
To include standard libraries
To store constants
Which of the following is a valid declaration of a variable in C?
int 1a;
double a=5;
float a;
char a@;
What is the purpose of decision-making statements in C?
To declare variables
To print output
To perform calculations
To execute code based on conditions
Which of the following is correct?
(a<9 && b<8)
(a<8) && (b<7)
(a>9 & b<9)
None of these
