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
B
Correct answer
Explanation
JavaScript fully supports error handling using try...catch...finally blocks, making the statement that it does not provide this feature false.
-
setTimeout('functionname()',4)
-
setTimeout('functionname()',4000)
-
setTimeout('functionname()',400)
-
None
B
Correct answer
Explanation
The setTimeout function in JavaScript expects the delay time to be specified in milliseconds. Since 1 second equals 1000 milliseconds, a 4-second delay requires a value of 4000.
-
Character
-
Date
-
Integer
-
RAW
D
Correct answer
Explanation
The RAW datatype is used for binary data that is not interpreted by the database. Unlike Character, Date, or Integer, which can be converted using functions like TO_CHAR or TO_NUMBER, RAW data is generally treated as a sequence of bytes without conversion.
-
LPVOID
-
LPCSTR
-
BOOL
-
LRESULT
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.
-
gives an abend
-
gives an error
-
no error
-
complier ignores
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.
-
int i[5][];
-
int i[][];
-
int []i[];
-
int i[5][5];
-
int[][] a;
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.
-
The beginning of the class definition.
-
The end of the class definition.
-
Anywhere in the class definition.
-
None of the above
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.
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.
-
to_char
-
to_number
-
to_string
-
to_date
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.
-
divert
-
convert
-
straight
-
revert
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.
-
This statement cannot be coded in Easytrieve
-
The input is could be inside the JOB activity
-
There is no input to this job statement
-
Both b & c
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.
-
A. Built-in
-
B. User-defined
-
C. User-function
-
D. Built-in, User-defined
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.
-
A. ++
-
B. Next
-
C. Skip
-
D. Step
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.