Computer Knowledge

Programming Fundamentals

2,381 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 programming languages
  1. Overriding

  2. Garbage Collection

  3. Assemblies

  4. Serialization

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

Garbage Collection is .NET's automatic memory management technique that reclaim memory from objects no longer in use, preventing memory leaks. Overriding is about polymorphism, Assemblies are deployment units, and Serialization converts objects to streams.

Multiple choice technology programming languages
  1. strtod()

  2. srttoi()

  3. atoi()

  4. None of these

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

atoi() is the standard C library function that converts a string representation of an integer to its int value. strtod() converts to double, srttoi() is a typo (likely meant strtol), and atoi is correct.

Multiple choice technology programming languages
  1. True

  2. False

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

The nested loop structure has a definite termination condition (i<5) and no modification to loop variables that would prevent termination. The outer loop runs i from 0 to 4, the inner loop has a fixed range, and both loops increment properly. This code will definitely terminate after a finite number of iterations - it does NOT go into an infinite loop.

Multiple choice technology programming languages
  1. VAR statement

  2. VARNUM Option

  3. Variables Statement

  4. all of the above

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

The VAR statement in PROC PRINT controls variable display order. VARNUM is not a valid SAS option, and there is no 'Variables Statement' in PROC PRINT. The VAR statement is the correct and only way to specify variable order in printed output.

Multiple choice technology mainframe
  1. O/P PROCEDUE and INPUT PROCEDURE both

  2. O/P PROCEDUE but not INPUT PROCEDURE

  3. INPUT PROCEDURE but not O/P PROCEDUE

  4. can't use both of them

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

In COBOL, the MERGE statement can specify an OUTPUT PROCEDURE to process merged records, but it does not support an INPUT PROCEDURE because input files must already be sorted.

Multiple choice technology programming languages
  1. 1 and 4

  2. 1

  3. 2 and 3

  4. 3 and 4

  5. no error

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

Line 1 fails because a double literal (4.5) cannot be implicitly assigned to a float without an 'f' suffix. Line 4 fails because a short cannot be implicitly assigned to a char due to range differences.

Multiple choice technology platforms and products
  1. the value keeps refreshing after some intervals of time

  2. the value is made thread safe automatically

  3. the value is not cached by the compiler for the purpose of optimization

  4. to make the value of a variable to be refreshed, everytime it is accessed

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

The volatile keyword in Java indicates that a variable may be modified by multiple threads. It prevents the compiler from caching the variable in CPU registers, ensuring reads and writes go directly to main memory for visibility. However, volatile does NOT provide full thread safety - compound actions still need synchronization.