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 technology
  1. For one tab

  2. For all tabs of the report

  3. Depends how it is defined as global or local.

  4. B and C both

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

Variables defined at the report level are accessible across all tabs within that report because they have global scope within the report context. Option A is incorrect because report-level variables are not limited to just one tab. Option C describes local versus global variables, but the question specifically asks about report variables, which are inherently global within the report.

Multiple choice technology programming languages
  1. True

  2. False

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

VALUE clauses should be avoided for dynamic variables because they are compile-time constants and cannot be changed at runtime. Dynamic variables need values assigned during program execution using MOVE or SET statements. Using VALUE clause on a dynamic variable creates a mismatch between compile-time and runtime behavior.

Multiple choice technology programming languages
  1. program will abort

  2. command will fail but last line will remain populated in the file- variables

  3. command will fail and file-variables will be blank

  4. the program will give a compile time error

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

If the AT END clause is omitted during a sequential READ statement in COBOL, and no appropriate declarative error handler is defined, the compiler cannot determine the end-of-file behavior, leading directly to a compile-time error rather than runtime failures.

Multiple choice technology embedded technologies
  1. Use Macros

  2. Usage of Structures

  3. Combination of Both Structures and Unions

  4. Macros and Structures

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

In resource-constrained low-level programming, defining structures with bit-fields combined inside unions allows developers to overlay small bit-width fields onto larger datatypes, effectively reusing or freeing the remaining bits of the character for other union members to optimize RAM usage.

Multiple choice technology programming languages
  1. True

  2. False

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

Exceptions can be rethrown in catch blocks using the 'throw' keyword without arguments (preserving the original exception) or by throwing a new exception. Rethrowing allows handling at multiple levels - do some local handling then propagate up.

Multiple choice technology web technology
  1. the page will shut down.

  2. the page is defined as a target and will be found by the arrow command.

  3. window will open blank.

  4. when clicking a link, it will open in a new window.

Reveal answer Fill a bubble to check yourself
Multiple choice technology programming languages
  1. int[,] myarray;

  2. int[][] myarray;

  3. int myarray[,];

  4. int[2] myarray;

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

In C#, int[,] myarray; declares a rectangular 2-dimensional array where all rows have the same length. Option B int[][] is a jagged array (array of arrays), option C has wrong syntax, and option D declares a fixed-size 1D array.

Multiple choice technology programming languages
  1. new operator cannot be overloaded

  2. void *operator new(size_t,int);

  3. void operator new;

  4. void *operator new;

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

The correct syntax for overloading new for arrays is void operator new. This returns a pointer (void) and takes size_t parameter. The [] indicates array allocation. Option C is incorrect because it returns void instead of void*. Option B is the scalar new overload syntax (no []). The new operator CAN be overloaded, including for arrays.