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. Start-of- selection

  2. top-of -page

  3. End-of- Selection.

  4. End- of- page

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

In SAP ABAP, when a program encounters a STOP statement, it triggers the End-of-Selection event. STOP immediately halts the current processing and jumps to the END-OF-SELECTION event block. This is different from termination events. Options A, B, and D are not the events triggered by STOP statement.

Multiple choice technology programming languages
  1. AT LAST

  2. AT TOP

  3. AT NEW OF

  4. AT END

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

AT LAST is a control break statement in report programming (like Ab Initio or COBOL). It triggers processing at the end of all data, after all records have been processed and all other control breaks (like AT NEW, AT END) have completed. Options B, C, and D are different types of control break statements but AT LAST is specifically for final end-of-data processing.

Multiple choice technology
  1. $mprjet
  2. $mpjret
  3. $mejret
  4. None of the above

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

In Ab Initio, the variable $mpjret (short for 'mp job return') is used to check the execution status of a graph. This variable contains the return code after running a graph using m_ui or air commands. A value of 0 typically indicates successful execution, while non-zero values indicate errors or warnings.

Multiple choice technology mainframe
  1. It's a JCL procedure and cannot be executed

  2. It's a job and may be submitted with a SUBMIT command.

  3. It's a JCL procedure and can be executed with a submit command.

  4. It's a JCL procedure and must be invoked in a job with an EXEC statement.

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

Like the previous JCL procedure question, a PROC is not a standalone executable job and cannot be run with a submit command. It must be invoked using an EXEC statement inside a JCL job stream. Therefore, option 556575 is correct.

Multiple choice technology mainframe
  1. It's a JCL procedure and cannot be executed.

  2. It's a job and may be submitted with a SUBMIT command.

  3. It's a JCL procedure and can be executed with a submit command.

  4. It's a JCL procedure and must be invoked in a job with an EXEC statement.

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

The prompt asks 'What is this and how can it be executed?' where 'this' refers to a JCL procedure. JCL procedures (PROCs) cannot be submitted directly as standalone jobs via SUBMIT; they must be called and executed within a job stream using an EXEC statement.

Multiple choice technology databases
  1. GADDE

  2. Gadde

  3. gADDE

  4. THERE IS NO FUNCTION LIKE initcap();

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

The Oracle SQL function INITCAP() converts the first letter of each word to uppercase and all remaining letters to lowercase. When applied to 'gadde', it returns 'Gadde' with only the first letter capitalized. This function is commonly used for formatting names and titles in database queries.

Multiple choice technology databases
  1. GADDE

  2. Gadde

  3. gADDE

  4. THERE IS NO FUNCTION LIKE initcap();

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

This is a duplicate of question 142268. The Oracle SQL function INITCAP() converts the first letter of each word to uppercase and all remaining letters to lowercase. When applied to 'gadde', it returns 'Gadde' with only the first letter capitalized.

Multiple choice technology databases
  1. DROP gen_email_name;

  2. REMOVE gen_email_name;

  3. DELETE gen_email_name;

  4. DROP FUNCTION gen_eamil_name;

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

DROP FUNCTION is the correct syntax to remove a stored function. Option D has correct syntax despite typo 'eamil_name' (question likely meant gen_email_name). DROP alone, REMOVE, and DELETE are incorrect.

Multiple choice technology web technology
  1. main task only

  2. rule tasks and functions

  3. sub flow task

  4. any task in rule flow

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

Initial actions can be defined specifically in sub-flow tasks within a rule flow. They are not limited to main tasks only (option A), nor can they be defined in all task types (option D). Rule tasks and functions (option B) have their own specific action definition mechanisms.

Multiple choice technology performance
  1. True

  2. False

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

Hard parse is more expensive than soft parse because hard parse involves optimization, query plan generation, and row source generation. Soft parse only checks the shared pool for an existing execution plan and skips these costly steps when a plan is found.

Multiple choice technology programming languages
  1. x contains an int value

  2. x contains an object of the Circle type.

  3. x contains a reference to a Circle object.

  4. You can assign an int value to x.

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

To understand this question, the user needs to have basic knowledge of object-oriented programming and class declaration. In the given declaration Circle x = new Circle(), we are creating an object of the Circle class.

Now let's go through each option to determine the correct answer:

A. x contains an int value: This statement is incorrect because the Circle class does not contain int values. Therefore, x cannot contain an int value.

B. x contains an object of the Circle type: This statement is correct. The code is creating an object of the Circle class and assigning it to the variable x. Therefore, x contains an object of the Circle type.

C. x contains a reference to a Circle object: This statement is correct. In Java, objects are created on the heap and accessed through references. When we create an object of a class, we are creating an instance of that class on the heap and assigning a reference to that instance to a variable.

D. You can assign an int value to x: This statement is incorrect because x is declared as an object of the Circle class, not as an int. Therefore, you cannot assign an int value to x.

The correct answer is: C. x contains a reference to a Circle object.

Multiple choice technology programming languages
  1. true, 1, Null

  2. false, 0, null

  3. true, 0, null

  4. true, 1, null

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

In Java, boolean fields default to false, numeric types (int, double, etc.) default to 0, and object types default to null. This is consistent across all primitive and reference types. Options A, C, and D incorrectly use 'true' or '1' for boolean or numeric defaults.

Multiple choice technology platforms and products
  1. Only when Job Finishes with out Warnings

  2. Only when Job Finishes with Warnings

  3. Only when Job Aborts

  4. All

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

After-job subroutines in DataStage execute regardless of job completion status - they run when the job finishes successfully, finishes with warnings, or aborts. This ensures cleanup and post-processing logic always executes.