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 programming languages
  1. LPVOID

  2. LPCSTR

  3. BOOL

  4. LRESULT

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

LRESULT is the data type used for return values from window procedures in Win32 API. It's designed to handle the various return values needed by window procedures, including handles, boolean values, and other status codes. LPVOID, LPCSTR, and BOOL are not appropriate return types for window procedures.

Multiple choice technology programming languages
  1. gives an abend

  2. gives an error

  3. no error

  4. complier ignores

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

In SAS, omitting the RUN; statement does not generate an error or cause an abend. SAS will compile the step, but it may not execute immediately until another step boundary (such as a subsequent DATA or PROC step) or a RUN; statement is encountered.

Multiple choice technology programming languages
  1. int i[5][];

  2. int i[][];

  3. int []i[];

  4. int i[5][5];

  5. int[][] a;

Reveal answer Fill a bubble to check yourself
B,C,E Correct answer
Explanation

Java allows blank dimensions on the left side of array declarations. int[][] a, int []i[], and int i[][] are valid (declaring array type). However, int i[5][] or int i[5][5] are invalid because dimensions cannot be specified in declaration - only during initialization.

Multiple choice technology programming languages
  1. The beginning of the class definition.

  2. The end of the class definition.

  3. Anywhere in the class definition.

  4. None of the above

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

DECLARE_MESSAGE_MAP must be the last declaration in a class definition, appearing just before the closing brace. This macro declares the message map member variables and methods used by MFC's message routing system. Placing it anywhere else violates MFC conventions and will cause compilation errors.

Multiple choice technology databases
  1. True

  2. False

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

CAST is a SQL function that converts an expression from one datatype to another. For example, CAST('123' AS NUMBER) converts a string to a number. It's standard SQL syntax available in Oracle.

Multiple choice technology databases
  1. to_char

  2. to_number

  3. to_string

  4. to_date

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

TO_CHAR, TO_NUMBER, and TO_DATE are all valid Oracle conversion functions. TO_STRING is not a standard Oracle function - the correct function name for converting to string is TO_CHAR. This question tests knowledge of exact function names.

Multiple choice technology databases
  1. divert

  2. convert

  3. straight

  4. revert

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

CONVERT is a valid Oracle SQL function that converts character strings from one character set to another. The other options (divert, straight, revert) are not standard Oracle functions.

Multiple choice technology programming languages
  1. This statement cannot be coded in Easytrieve

  2. The input is could be inside the JOB activity

  3. There is no input to this job statement

  4. Both b & c

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

JOB INPUT NULL is a valid Easytrieve statement that specifies no input file for the JOB. Option C correctly states there is no input to this job statement. Option B, though poorly worded, correctly indicates that input can be specified inside the JOB activity itself. Therefore, both statements B and C are valid.

Multiple choice technology testing
  1. A. Built-in

  2. B. User-defined

  3. C. User-function

  4. D. Built-in, User-defined

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

UFT/QTP supports two types of environment variables: Built-in variables (predefined by the tool) and User-defined variables (created by testers). Built-in variables include system information like test path, OS type, and test name. User-defined variables can be added manually and accessed programmatically.

Multiple choice technology testing
  1. A. ++

  2. B. Next

  3. C. Skip

  4. D. Step

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

The Step keyword in VBScript For loops defines how the counter variable increments. Default increment is 1, but Step allows custom increments like Step 2 (count by 2) or Step -1 (count backwards). The Next keyword marks the end of the loop body, ++ is not valid VBScript, and Skip is not a loop keyword.