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

Multiple choice
  1. never execute

  2. always execute

  3. execute if catch block will execute

  4. execute if catch block will not execute

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A block labelled as finally, just after the catch statements, will always be executed.

Multiple choice
  1. Yes

  2. No

  3. Sometimes

  4. with brute force

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The main method is a static entry point for the JVM and cannot be overridden in the traditional sense of polymorphism.

Multiple choice physics universe and space science launching of an artificial satellites around the earth launching of satellite india’s space programmes

Validation of programs is used to check that data is

  1. In right format

  2. Of right type

  3. Within possible value ranges

  4. All of above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Data validation is a process of ensuring data have undergone data cleansing to ensure they have data quality i.e they are both correct and useful. Apart from data cleansing the data must be within possible value range that ensures smooth and effective functioning of the space satellite. Hence all the three option are correct.

Multiple choice accountancy accounting software - tally concept of entity and relationship designing and creating simple tables, forms, and queries objective in dbms

In macro programming, the objects using individual instructions called ______-oriented actions are manipulated.

  1. forms

  2. pages

  3. queries

  4. macro

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In macro programming, the objects using individual instructions called macro-oriented actions are manipulated. A macro is a list of macro-oriented actions that run as a unit. Access provides for such macro programming.

Multiple choice
  1. Code that can only be used once in the application

  2. Reusable pieces of code that can be called on repeatedly.

  3. A special type of variable

  4. Indefinite arrays

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Functions are blocks of organized, reusable code that perform a single, related action. They allow for modularity and avoid code repetition.

Multiple choice
  1. Integers

  2. Floats

  3. Numbers

  4. Booleans

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Comparison operators in Python (like ==, !=, <, >) evaluate the relationship between values and return a boolean result, which is either True or False.

Multiple choice
  1. makes code more readable

  2. allows us to select between multiple outcomes

  3. allows functions to be called

  4. allows the interpreter to print values to the console

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Control flow refers to the order in which individual statements, instructions, or function calls are executed. It allows programs to make decisions (branching) and repeat actions (looping) based on conditions.

Multiple choice
  1. using a while loop

  2. repetition

  3. using a for loop

  4. start again

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Iteration refers to the process of repeating a block of code. 'Start again' is not a formal definition of iteration in programming.

Multiple choice
  1. print("hello)

  2. for i range(10):

  3. for line in file

  4. def myFunction():

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Option D is a valid function definition. Option A is missing a closing quote, B is missing the 'in' keyword, and C is missing a colon.

Multiple choice
  1. Selection

  2. Iteration

  3. Sequence

  4. Variables

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A for loop is a fundamental programming structure used to repeat a block of code multiple times, which is the definition of iteration. Selection refers to conditional logic (if statements), and sequence refers to the order of execution.

Multiple choice
  1. print()

  2. float()

  3. num1 = 9

  4. int()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A variable is a named storage location for data. In 'num1 = 9', 'num1' is the variable name being assigned the value 9. The other options are function calls or type conversion functions.

Multiple choice
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Float is a fundamental data type in Python and many other languages used to store numbers that have fractional parts.