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
-
Condition
-
Loop
-
Label
-
None of above
B
Correct answer
Explanation
A loop is a control structure that repeats a sequence of statements until a specific condition is met.
-
address of a varible
-
indication of a variable
-
variable which stores the address of another varible
-
none of the above
C
Correct answer
Explanation
A pointer is a variable that stores the memory address of another variable, allowing for indirect access to data.
-
looping
-
iteration
-
condition
-
all of the above
C
Correct answer
Explanation
If-else statements are control flow structures used to execute code blocks based on the evaluation of a boolean condition. They are not used for looping or iteration directly.
-
skip
-
next
-
goto
-
none of the above
C
Correct answer
Explanation
The goto statement is an unconditional jump statement that transfers program control to a labeled statement elsewhere in the same function.
-
ending of the loop
-
beginning of the loop
-
middle of the loop
-
none of the above
B
Correct answer
Explanation
In a do-while loop, the 'do' keyword marks the beginning of the loop block, while the condition is checked at the end.
-
address of a varible
-
indication of a variable
-
variable which stores the address of another variable
-
none of the above
C
Correct answer
Explanation
A pointer is a variable that stores the memory address of another variable, allowing indirect access to the data stored at that address.
-
LIFO
-
FIFO
-
FILO
-
None of the above
A
Correct answer
Explanation
A stack is a linear data structure that follows the Last-In, First-Out (LIFO) principle, where the last element added is the first one to be removed.
-
Imperative statement
-
Declarative statement
-
Assembler directives
-
Either Declarative statement or Assembler directives
-
None of these
A
Correct answer
Explanation
This statement indicates an action to be performed during the execution of the assembled program.
-
32767
-
� 32767
-
1.7014e+38
-
�1.7014e+38
A
Correct answer
Explanation
A 16-bit signed integer uses one bit for sign, leaving 15 bits for magnitude. The maximum value is 2^15 - 1 = 32767. This is a standard limit in older C implementations with 16-bit ints.
-
float ptr
-
float *ptr
-
*float ptr
-
none of these
B
Correct answer
Explanation
In C, a pointer variable is declared by placing an asterisk before the variable name, such as float *ptr.
-
address of operator
-
value at address
-
address of a variable
-
none of these
B
Correct answer
Explanation
The asterisk (*) operator, when used in pointer notation, is the dereference operator, which retrieves the value stored at the memory address held by the pointer.
-
inside the function
-
outside the function
-
within the function
-
none of these
B
Correct answer
Explanation
Pointers allow functions to modify variables defined outside their local scope by passing the memory address of those variables.
-
puts( );
-
gets( );
-
getchar( );
-
none of these
C
Correct answer
Explanation
The getchar() function is specifically designed to read a single character from the standard input.
-
's' is a float variable
-
's' is going to contain a floating point value
-
's' contains the address of a floating point variable
-
none of these
C
Correct answer
Explanation
The declaration float *s defines s as a pointer to a float, meaning it holds the memory address where a float value is stored.
-
scanf( )
-
gets( );
-
getchar( );
-
getche( );
A
Correct answer
Explanation
The scanf() function is the standard library function used to read formatted input, including integers, from the keyboard.