NEW
Font size
WorksheetsChapter 1 - Fundamental Programming
Total questions: 25
Worksheet time: 13mins
Which of the following is not a valid C variable name?
int number;
float rate;
int variable_count;
int $main;
Which of the following is true for variable names in C?
They can contain alphanumeric characters as well as special characters
It is not an error to declare a variable to be one of the keywords(like goto, static)
Variable names cannot start with a digit
Variable can be of any length
What is #include <stdio.h>?
Preprocessor directive
Inclusion directive
File inclusion directive
None of the mentioned
The C-preprocessors are specified with _________ symbol.
#
&
%
*
scanf() is a predefined function in______header file.
stdlib. h
ctype. h
stdio. h
stdarg. h
Which is valid C expression?
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
What is the only function that all C++ programs must contain?
main ()
void ()
system ()
start ()
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
What is the function of % operator?
add
devide
substract
remainder
Which of these is not a correct variable data type?
int
float
real
char
Which data type is used to store decimal numbers in C?
int
float
double
char
Which data type is used to store single characters in C?
char
int
float
string
Which type of error is difficult to detect as it does not result in any error messages?
Syntax error
Runtime error
Compilation error
Logical error
If a program compiles successfully but does not produce the desired output, what type of error is likely present?
Logical error
Compilation error
Runtime error
Syntax error
When a program contains misspelled keywords or missing punctuation, what type of error is it classified as?
Runtime Error
Semantic Error
Logic Error
Syntax Error
Pascal, Python, Java, basic and C++ are all _______________
computer program
programming language
windows software
foreign language
Someone who writes computer program called ___________.
Program
Programming
Programmer
What does the oval symbol represent in a flowchart?
Data Input
Process
Start/End
Decision Point
What does the rectangle symbol represent in a flowchart?
Decision point
Start/End point
Process or action
Data input/output
What does the parallelogram symbol represent in a flowchart?
Database storage
Decision point
Mathematical calculations
Input or output operations
What does the diamond symbol represent in a flowchart?
End
Start
Decision
Loop
Which function is used to take input from the user in C?
getchar
scanf
input
Which function is used to display output in C?
display()
printf()
output()
print()
