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
-
declarative
-
executable
-
exception handling
-
none of above
A
Correct answer
Explanation
A PL/SQL block is divided into three sections: the declarative part (for variables/constants), the executable part, and the exception handling part.
-
IF
-
IF THEN ELSE IF
-
EXIT WHEN
-
GO TO
C
Correct answer
Explanation
The EXIT WHEN statement is used in PL/SQL loops to terminate the loop execution immediately when a specific condition is met.
-
IF
-
IF THEN ELSE IF
-
EXIT WHEN
-
GO TO
D
Correct answer
Explanation
The GOTO statement allows the program to jump unconditionally to a specified label within the same block.
-
Condition
-
Loop
-
Label
-
None of above
B
Correct answer
Explanation
A loop is a control structure that repeats a sequence of statements until a specific condition is met.
-
declarative
-
executable
-
exception handling
-
none of above
A
Correct answer
Explanation
All variables, constants, and user-defined exceptions must be declared in the declarative section of the PL/SQL block.
-
macro
-
for loop
-
symbolic constant
-
none of these
C
Correct answer
Explanation
The #define preprocessor directive is primarily used to create symbolic constants or macros. Between the options, symbolic constant is a standard use case.
-
address of a varible
-
indication of a variable
-
variable which stores the address of another varible
-
none of the above
C
Correct answer
Explanation
A pointer is a variable that stores the memory address of another variable, allowing for indirect access to data.
-
macro
-
stack
-
preprocessor
-
none of the above
C
Correct answer
Explanation
The preprocessor is the first stage of the C compilation process, which handles directives like #include and #define before the actual compilation begins.
-
iteration
-
recursion
-
repeater
-
none of the above
B
Correct answer
Explanation
Recursion is a programming technique where a function calls itself to solve a problem by breaking it down into smaller, similar sub-problems.
-
looping
-
iteration
-
condition
-
all of the above
C
Correct answer
Explanation
If-else statements are control flow structures used to execute code blocks based on the evaluation of a boolean condition. They are not used for looping or iteration directly.
-
two
-
one
-
three
-
none of the above
A
Correct answer
Explanation
In C, variables generally have two primary scopes: local scope (within a function or block) and global scope (accessible throughout the program).
-
declaration
-
initialization
-
calling
-
none of the above
A
Correct answer
Explanation
Header files (.h) are primarily used to store declarations of functions, variables, and macros so that they can be shared across multiple source files.
-
skip
-
next
-
goto
-
none of the above
C
Correct answer
Explanation
The goto statement is an unconditional jump statement that transfers program control to a labeled statement elsewhere in the same function.
-
break
-
exit()
-
goto
-
none of the above
B
Correct answer
Explanation
The exit() function, defined in stdlib.h, is used to terminate the entire program immediately, regardless of where it is called.
-
private
-
local
-
global
-
none of the above
C
Correct answer
Explanation
Global variables are defined outside of any function and are accessible throughout the entire program, making them available to all parts of the code.