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. It produces the output Procedure B calling C

  2. It produces the output Procedure C calling B

  3. It produces a compilation error because procedure C requires a forward declaration

  4. It produces a compilation error because procedure B requires a forward declaration.

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

In PL/SQL packages, procedures must be declared before they can be called by other procedures in the same package specification or body. If procedure B calls procedure C, and C is defined after B in the package body without a forward declaration, the compiler cannot resolve the reference to C when compiling B.

Multiple choice technology
  1. TRUE

  2. SUCCESS

  3. AND

  4. NULL

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

The Informatica transformation language has reserved keywords that cannot be used as identifiers. TRUE, AND, and NULL are all reserved keywords with specific meanings. SUCCESS is not part of the reserved keyword set - it can be used as a user-defined variable name or column alias without conflict. This distinction matters when naming transformation ports or variables.

Multiple choice technology programming languages
  1. i

  2. iii

  3. a & b

  4. a & c

  5. a,b,c

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

In SAP BusinessObjects, the If() function is used to conditionally format or display rows in a block (i) and to display dynamically grouped values (iii). Scheduled reports (ii) and dynamic lists of values (iv) are managed through query filters and scheduling options rather than the If() function. The option text uses 'a & c' to represent 'i & iii'.

Multiple choice technology mainframe
  1. a program must always begin with a PROCEDURE statement and end with an END statement

  2. PL/I instructions can be coded between positions 1 and 72

  3. you have to declare each variable that you are going to use

  4. a program can be composed out of different procedures

  5. comment lines have to be preceded by //

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

PL/I programs must begin with a PROCEDURE statement and end with an END statement as structural requirements. The language supports modular programming by allowing programs to be composed of multiple procedures. Claims about column limits and mandatory variable declarations are incorrect, and PL/I uses /* */ for comments, not //.

Multiple choice technology mainframe
  1. REPEAT 5 TIMES;instruction;END;

  2. DO J=1 TO 5;instruction;END;

  3. COUNTER = 1;DO WHILE COUNTER < 5;COUNTER = COUNTER + 1;instruction;END;

  4. REPEAT VARYING COUNTER FROM 1 BY 1 UNTIL COUNTER = 5;instruction;END;

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

PL/I uses the DO loop construct for iteration control. The correct syntax for repeating an instruction 5 times is DO J=1 TO 5; instruction; END; which creates a controlled loop with an index variable. The REPEAT keyword doesn't exist in PL/I, and the WHILE option would require different initialization and would execute only 4 times with < 5 condition.

Multiple choice technology mainframe
  1. after each declaration of a variable

  2. at the end of each instruction

  3. to end a DO instruction

  4. at the end of the program

  5. to end an IF instruction

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

In PL/I, semicolons terminate statements rather than acting as separators. Thus, a semicolon is required at the end of each statement (instruction), to terminate groups like DO, and to terminate the program block. However, the options listed are slightly confusing as a DO instruction ends with a separate END statement, which contains a semicolon, but 'at the end of each instruction', 'at the end of the program', and 'to end an IF instruction' (which is terminated by a semicolon) align with PL/I statement terminator rules.