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. macro

  2. for loop

  3. symbolic constant

  4. none of these

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. address of a varible

  2. indication of a variable

  3. variable which stores the address of another varible

  4. none of the above

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

A pointer is a variable that stores the memory address of another variable, allowing for indirect access to data.

Multiple choice
  1. iteration

  2. recursion

  3. repeater

  4. none of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. looping

  2. iteration

  3. condition

  4. all of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. two

  2. one

  3. three

  4. none of the above

Reveal answer Fill a bubble to check yourself
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).

Multiple choice
  1. declaration

  2. initialization

  3. calling

  4. none of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. private

  2. local

  3. global

  4. none of the above

Reveal answer Fill a bubble to check yourself
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.