Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
-
C# Language Code
-
Assembly Language Code
-
Intermediate Language which CLR understands
-
Pseudo-code
C
Correct answer
Explanation
C# code is compiled to Intermediate Language (IL), also called Microsoft Intermediate Language (MSIL). The CLR (Common Language Runtime) executes IL through JIT compilation to native machine code. This is different from the original C# source code, assembly language, or pseudocode.
-
char * (f* (*) ))
-
char * ( f) (()());
-
(char) (f) (());
-
(char) (*f) ()();
B
Correct answer
Explanation
This declares a function pointer 'f' that returns a char pointer and takes one argument - a pointer to a function taking no arguments and returning nothing. The syntax is 'char (*f)(void ()(void))' or equivalent with spacing. Option B's parenthetical structure, despite spacing oddities, best represents this complex declaration.
-
Restructure EXtended eXecutor language
-
Restructured EXtending eXecutor language
-
Restructured EXtended eXecutor language
-
Restructured EXtended eXecution language
C
Correct answer
Explanation
REXX (Restructured EXtended eXecutor) is a programming language developed by IBM. The official expansion emphasizes its restructured design and extended execution capabilities. It's commonly used on mainframe systems for scripting and automation.
D
Correct answer
Explanation
In REXX, the LEAVE statement causes immediate exit from the current DO-END loop and execution continues with the statement following END. The EXIT statement would terminate the entire program, not just the loop. FINISH is not a REXX keyword.
-
The above exec will prompt the user for a code until the user enters the code ‘BYE’
-
The above exec will prompt the user for a code until the user enters the code ‘EXIT’.
-
Gives Error while Executing
-
The above exec will prompt the user for a code until the user enters the code ‘END’.
A
Correct answer
Explanation
The REXX script uses a Do forever loop to repeatedly prompt the user and read input using Pull code. The Pull instruction converts input to uppercase. If the input matches 'BYE', the Leave statement terminates the loop, and the program exits. Other options specify incorrect termination conditions.
-
a.) Ankur
-
b.) Ank
-
c.) Missing (character missing value)
-
d.) ‘Ankur’
A
Correct answer
Explanation
The DATA step assigns test = 'X'. The select statement evaluates test, and the when('X') branch executes, assigning the character string 'Ankur' to the variable Name.
-
deletes buffer in the stack
-
deletes buffer and all elements of stack
-
deletes elements of stack
-
All the above
B
Correct answer
Explanation
In SAP, the DROPBUF 0 command deletes the buffer and ALL elements of the stack. The argument '0' specifies deleting all buffers and stack contents. Option A is incomplete (only buffer), Option C is incomplete (only stack elements), so Option B correctly describes the complete action.
A
Correct answer
Explanation
The COBOL PERFORM statement, especially when used with the UNTIL phrase, functions as a conditional loop. This is equivalent to DO WHILE or while loops in Java or C++. IF is a conditional branch, METHOD is a function definition, and FOR is a different loop structure.
-
LINKDECK
-
LINKLIB
-
LINKEDIT
-
All the above
-
Used to initialize some value to a variable
-
Numeric values are set to zero, alphabetic and alphanumberic variables are set to spaces.
-
All variables are set to spaces.
-
None of the above
B
Correct answer
Explanation
The INITIALIZE verb sets numeric data to zeros and alphanumeric/alphabetic data to spaces. It's a convenient way to reset data items to their default empty values without setting each one individually.
-
Will contain zeroes if numeric and spaces if alphabetic or alphanumeric
-
Will contain spaces for all variables
-
Will contain an undefined value
-
None of the above
C
Correct answer
Explanation
In COBOL, uninitialized variables contain whatever garbage data happens to be in their allocated memory location, making their initial value undefined. They do not automatically default to spaces or zeroes unless explicitly initialized using the VALUE clause or the INITIALIZE statement.
-
Function Module
-
Subroutinue
-
Macro
-
Event
A
Correct answer
Explanation
The interface between an application program and a Smart Form is a Function Module. When a Smart Form is activated, the system automatically generates a function module that serves as the interface, allowing the application program to call and execute the form.
-
Load & PreLoad
-
Preload & PostStore
-
Load & Store
-
Store & PreStore
C
Correct answer
Explanation
In business workflow implementation, Load and Store subroutines are used to handle business tasks. Load fetches data at the start, and Store saves results after processing. The other combinations are not standard subroutine pairs in this context.
-
Global
-
Task
-
Local
-
Application
A
Correct answer
Explanation
Global variables are typically application-specific in the sense that they are scoped to and persist throughout a single application instance, as opposed to system-wide or session-scoped variables. Task, Local, and Application variables represent different scoping levels.
-
STATIC,EXIT,GLOBAL
-
GLOBAL,STATIC,DYNAMIC
-
EXIT,POSTSTORE,COMPLETE
-
STATIC, TEMPORARY,DYNAMIC
D
Correct answer
Explanation
Tasks in BTM can have three behavior types: STATIC (compiled/unchanging), TEMPORARY (runtime-created), and DYNAMIC (can change during execution). These categories define how tasks are loaded, managed, and executed within the workflow engine.