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
-
Boolean
-
Variant
-
String
-
None of these
B
Correct answer
Explanation
Variant data type hold data of any datatype except strings that have fixed lengths or datatype that have been created by user.
-
Private scope
-
Module scope
-
Public scope
-
None of these
C
Correct answer
Explanation
Public scope of variables allows accessiblity to user, available at all the modules and procedure in an application.
-
compilation
-
assembling
-
debugging
-
execution
C
Correct answer
Explanation
Debugging is the process of identifying and fixing errors in a computer program. It involves testing, analyzing code behavior, and making corrections to eliminate bugs. Compilation translates source code into machine code but doesn't fix errors. Assembling converts assembly language to machine code. Execution simply runs the program without making corrections. Only debugging specifically focuses on correcting program errors.
A
Correct answer
Explanation
It is the right answer. According to the given operations, first push A, then B and C. After that, perform the pop operation two times. This will delete B and C. Now again, push D and E, at last perform the pop operation, which deletes the last inserted item E. Now, the value of the top of the stack is D.
-
This is an attempt to delete an element from the already empty stack.
-
This is an attempt to remove an element from the top of the stack.
-
This is an attempt to insert an element to the top of the stack.
-
This is an attempt to delete an element from the already full stack.
-
None of the above
A
Correct answer
Explanation
This is true about stack underflow.
-
Push
-
Pop
-
Peek
-
Size
-
None of the above
E
Correct answer
Explanation
All of the above are the operations of a stack.
-
Push
-
Pop
-
isEmpty
-
Peek
-
None of the above
A
Correct answer
Explanation
This operation requires parameters as the item to be inserted.
-
break
-
goto
-
continue
-
if
-
else
B
Correct answer
Explanation
This is the definition of goto statement.
-
goto
-
break
-
continue
-
if else
-
switch
C
Correct answer
Explanation
Yes, it takes the control to the beginning of the loop.
-
goto
-
continue
-
break
-
if else
-
switch
C
Correct answer
Explanation
Yes, it takes the control out of the loop.
-
true
-
false
-
finite
-
infinite
-
not define
B
Correct answer
Explanation
It is a false statement without indexing.
-
Pass by reference
-
Pass by value
-
Pass by object
-
Pass by integer
-
Pass by float
B
Correct answer
Explanation
In pass by value, the value of original variable remains unchanged.
-
enum
-
union
-
array
-
struct
-
main
D
Correct answer
Explanation
It is used to create structure.
-
entry controlled loop
-
exit controlled loop
-
exit-entry controlled loop
-
entry-exit controlled loop
-
output controlled loop
A
Correct answer
Explanation
As it controls entry and if entry condition is true, then you can go into the loop otherwise you cannot enter into the loop.
-
entry controlled loop
-
exit controlled loop
-
input controlled loop
-
output controlled loop
-
entry-exit controlled loop
B
Correct answer
Explanation
It is called exit controlled loop because the body of loop is executed at least once if condition is false.