Computer Knowledge
Programming Fundamentals
2,611 Questions
Programming fundamentals form the core logic of software development and computer science. This includes variable declarations, pointer assignments, loop iterations, and exception handling. These technical topics are regularly tested in computer knowledge and IT officer competitive examinations.
Variables and arraysPointer assignmentsLoop iterationsException handling blocksCompile time errorsFunction references
Programming Fundamentals Questions
-
sequence
-
choice
-
iteration
-
none of the above
C
Correct answer
Explanation
Iteration is the control structure that allows a block of code to be executed repeatedly, forming a loop. Sequence is the default execution order, and choice refers to conditional branching.
-
a machine language program
-
an assembly language program
-
a BASIC program
-
a PASCAL program
D
Correct answer
Explanation
Pascal is a strongly typed language that requires all variables to be declared in a specific declaration block before they are used in the program body. Machine and assembly languages do not have this high-level declaration requirement.
-
mathematical function
-
string function
-
main function
-
recursive function
-
member function
D
Correct answer
Explanation
This function in C++ is a function that calls itself and the process of calling of a function by itself is called recursion.
-
When the inline function definition is too long or too complicated
-
When the inline function is recursive
-
When the inline function has looping constructs
-
When the inline function has a switch or a goto statement
-
When the inline function starts with the keyword 'inline'
E
Correct answer
Explanation
This is a situation where an inline function may work in C++ as an inline function must start with the keyword 'inline'.
-
stdio.h
-
iostream.h
-
stdlib.h
-
iomanip.h
-
math.h
C
Correct answer
Explanation
This header file in C++ is used to declare conversion routines, search/sort routines and other miscellaneous things.
-
internal change
-
inter-module change
-
side effect
-
side-module update
-
an integer
-
a string variable
-
a float
-
none of the above
-
we use * before it in its declaration
-
we use ** before it in its declaration
-
we use *** before it in its declaration
-
all of the above
-
integer
-
number of values which it reads
-
both the above
-
none of the above
-
rev
-
strlwr
-
strlen
-
strev
-
strrev
E
Correct answer
Explanation
“strrev” is the standard library string function which is used to reverse a string.
-
underflow
-
overflow
-
garbage value
-
Both (1) and (2)
-
None of these
A
Correct answer
Explanation
POP is used to read the last value stored in a stack. If the stack is empty, an error condition, i.e. underflow will result on performing POP.
-
Transient
-
do while
-
Boolean
-
Try
-
Implements
B
Correct answer
Explanation
Except “do while”, all the others are Java keywords. “do while” is a keyword of C programming language.
-
A keyword in C
-
An error condition
-
Standard output error stream
-
Standard logging stream
-
Operator in UNIX
C
Correct answer
Explanation
C++ provides some basic input/output stream. Cerr is one of such streams used for standard output error.
-
while
-
else if
-
for
-
do while
-
None of these
D
Correct answer
Explanation
Do while is a looping technique used in C programming, which first executes the statement and then checks the conditions. So, it is exit controlled. While and for are entry controlled.