Computer Knowledge
Programming Fundamentals
2,381 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
-
int *p; *p = 0x200;
-
int *p = &0x200;
-
int *p = *0x200;
-
int *p = 0x200;
-
Stub
-
Driver
-
Proxy
-
None of the above
B
Correct answer
Explanation
A driver is a test harness or program that calls the function under test and passes it test data. Conversely, a stub is a dummy implementation called by the function under test to simulate missing dependencies.
-
Stub
-
Driver
-
Proxy
-
None of the above
B
Correct answer
Explanation
A driver is a test harness or program that calls the function under test and passes it test data. Conversely, a stub is a dummy implementation called by the function under test to simulate missing dependencies.
-
Stub
-
Driver
-
Proxy
-
None of the above
B
Correct answer
Explanation
A driver is a test component that calls the function being tested with test data and verifies the results. Unlike stubs (which simulate dependencies) or proxies, drivers actively invoke the function under test.
-
Overriding
-
Garbage Collection
-
Assemblies
-
Serialization
B
Correct answer
Explanation
Garbage Collection is .NET's automatic memory management technique that reclaim memory from objects no longer in use, preventing memory leaks. Overriding is about polymorphism, Assemblies are deployment units, and Serialization converts objects to streams.
-
strtod()
-
srttoi()
-
atoi()
-
None of these
C
Correct answer
Explanation
atoi() is the standard C library function that converts a string representation of an integer to its int value. strtod() converts to double, srttoi() is a typo (likely meant strtol), and atoi is correct.
-
EXEC statement
-
CNTL statement
-
PROC statement
-
PEND statement
D
Correct answer
Explanation
The PEND statement marks the end of an in-stream procedure in JCL. In-stream procedures start with PROC and must be terminated with PEND. EXEC executes a program or procedure, CNTL is for control statements, and PROC begins a procedure definition.
B
Correct answer
Explanation
The nested loop structure has a definite termination condition (i<5) and no modification to loop variables that would prevent termination. The outer loop runs i from 0 to 4, the inner loop has a fixed range, and both loops increment properly. This code will definitely terminate after a finite number of iterations - it does NOT go into an infinite loop.
-
VAR statement
-
VARNUM Option
-
Variables Statement
-
all of the above
A
Correct answer
Explanation
The VAR statement in PROC PRINT controls variable display order. VARNUM is not a valid SAS option, and there is no 'Variables Statement' in PROC PRINT. The VAR statement is the correct and only way to specify variable order in printed output.
-
O/P PROCEDUE and INPUT PROCEDURE both
-
O/P PROCEDUE but not INPUT PROCEDURE
-
INPUT PROCEDURE but not O/P PROCEDUE
-
can't use both of them
B
Correct answer
Explanation
In COBOL, the MERGE statement can specify an OUTPUT PROCEDURE to process merged records, but it does not support an INPUT PROCEDURE because input files must already be sorted.
-
1 and 4
-
1
-
2 and 3
-
3 and 4
-
no error
A
Correct answer
Explanation
Line 1 fails because a double literal (4.5) cannot be implicitly assigned to a float without an 'f' suffix. Line 4 fails because a short cannot be implicitly assigned to a char due to range differences.
-
the value keeps refreshing after some intervals of time
-
the value is made thread safe automatically
-
the value is not cached by the compiler for the purpose of optimization
-
to make the value of a variable to be refreshed, everytime it is accessed
C
Correct answer
Explanation
The volatile keyword in Java indicates that a variable may be modified by multiple threads. It prevents the compiler from caching the variable in CPU registers, ensuring reads and writes go directly to main memory for visibility. However, volatile does NOT provide full thread safety - compound actions still need synchronization.
-
floating-point
-
double
-
boolean
-
function
C
Correct answer
Explanation
In Hungarian notation, 'f' prefix indicates a boolean flag or boolean value. Floating-point would use 'd' (double) or 'f' only if differentiating float types. The 'Busy' suffix further suggests this is a true/false state.
-
an array of unsigned long
-
an array of floating-point values
-
an array of unary
-
an array of zero-terminated strings
A
Correct answer
Explanation
In Hungarian notation: 'a' = array, 'u' = unsigned, 'l' = long. So 'aulColors' decodes to 'array of unsigned long'. This is standard Hungarian prefix composition for complex types.
B
Correct answer
Explanation
SmartClient cannot load PDF and Word documents in an iframe directly. While CSV and XML can be handled through data sources, PDF and Word require browser plugins or server-side conversion - SmartClient doesn't provide native iframe loading for these formats.