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 web technology
  1. //TU00001T JOB (ATUT000,,,,,,,,),TU00001,CLASS=7,MSGCLASS=X

  2. //TU00001T JOB (ATUT000),’TU00001’,CLASS=7,MSGCLASS=X

  3. //TU00001T JOB TU00001,’(ATUT000)’,CLASS=7,MSGCLASS=X

  4. //TU00001T JOB ,(ATUT000),CLASS=7,MSGCLASS=X

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

JCL JOB statement positional parameters follow strict order: accounting information (in parentheses), then programmer name. Option A correctly places accounting info (ATUT000) in positional form followed by the programmer name (TU00001). Option B is equivalent with quoted parameters. Options C and D are incorrect because they reverse the positional order or use improper syntax.

Multiple choice technology mainframe
  1. INFO-PROGRAM-ID

  2. INFO-CONVERSATION

  3. INFO-PREVIOUS-PROGRAM-ID

  4. INFO-FUNCTION-KEY

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

INFO-FUNCTION-KEY is specifically designed to store the function key number when a function key is received in CICS. The other variables serve different purposes: INFO-PROGRAM-ID for program name, INFO-CONVERSATION for mode status, and INFO-PREVIOUS-PROGRAM-ID for tracking the prior program.

Multiple choice technology testing
  1. Dim Statement

  2. Con Statement

  3. Const Statement

  4. Option Explicit Statement

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

The Const statement is used to declare constants in QTP (VBScript syntax). Dim declares variables, Con is not a valid statement, and Option Explicit forces variable declaration but doesn't create constants.

Multiple choice technology mainframe
  1. INFO-PROGRAM-ID

  2. INFO-PREVIOUS-PROGRAM-ID

  3. INFO-CONVERSATION

  4. INFO-PASSOFF

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

In APS (Application Development System) COBOL generators, the INFO-PASSOFF variable is set to 'Y' when the program is invoked using a PASSOFF statement, whereas the other options store different context metadata.

Multiple choice technology mainframe
  1. Identification Division.

  2. Program-ID.

  3. Program-name.

  4. All the above

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

To compile a COBOL program without errors, the minimum requirements are: Identification Division (which contains the Program-ID paragraph) and the Program-ID paragraph itself (which specifies the program name). All these components are mandatory and must be present for the program to be syntactically valid and compilable.

Multiple choice technology web technology
  1. All .NET compilers produce only verifiably type-safe code.

  2. Visual Basic .NET and C# produce verifiably type-safe code if you avoid certain constructs.

  3. Only Visual C++ with Managed Extensions produces verifiably type-safe code.

  4. Visual C++ with Managed Extensions produces verifiably type-safe code if you avoid certain constructs.

  5. C++ and C# cannot produce verifiably type-safe code.

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

Verifiably type-safe code passes the CLR's verification without throwing exceptions. C# and VB.NET produce verifiably type-safe code if you avoid unsafe constructs like pointers. Visual C++ with Managed Extensions defaults to unsafe code but can produce verifiable code if you avoid certain constructs. Not all .NET languages produce verifiable code by default.

Multiple choice technology programming languages
  1. macro functions are expanded during compile. Inline functions are just usual functions calls

  2. macro functions are expanded during preprocessing and inline functions are expanded during compile

  3. macro functions are expanded during compile and inline functions are expanded during preprocessing

  4. No difference.Both are expanded at compile.

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

Macro functions (created with #define) are expanded by the preprocessor before compilation begins, resulting in text substitution. Inline functions are expanded by the compiler during compilation, with the inline keyword being a hint (not a guarantee) for function call replacement. Option A is wrong because it misstates when inline expansion occurs. Option C reverses the correct phases.

Multiple choice technology mainframe
  1. Positional

  2. Keyword

  3. Any of these

  4. None of these

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

In JCL (Job Control Language for IBM mainframes), parameters can be positional or keyword. Positional parameters MUST be coded first and are interpreted based on their order in the statement. Keyword parameters (NAME=value) can come after positional ones and are self-identifying. This ordering rule is mandatory - you cannot place keyword parameters before positional ones.

Multiple choice technology mainframe
  1. //

  2. /*

  3. **

  4. //*

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

JCL comment lines begin with //* in the first two columns. The //* sequence indicates that the rest of the line is a comment. Option A // is used for JCL statements (not comments). Option B /* is C-style comment syntax (not JCL). Option C ** is not JCL comment syntax. Only Option D //* correctly identifies the JCL comment format.