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
-
5sum
-
Not/Ok
-
AvgSpeed
-
current-temp
-
Del hi
C
Correct answer
Explanation
This is the only valid variable declaration in Java as it begins with letter only.
-
Member
-
Manipulator
-
Allocator
-
Operator
-
Constructor
B
Correct answer
Explanation
Manipulators are objects that can modify a stream using the << or >> operators.
-
Integer and float
-
String and float
-
Character and string
-
Integer or character
-
Float and double
D
Correct answer
Explanation
Only integer or character variables are used with case keyword.
-
Concrete manifestation of a token in the text
-
Key words
-
White spaces
-
Value of an integer token defines value of identifier M
-
Delimiter
D
Correct answer
Explanation
Attributes define the token by its value.
-
It generates symbol table and generates code afterwards.
-
It allows labels, which can be defined after it is used.
-
It does not allow defining a function after it has been called in the program.
-
It allows a forward definition of a symbol or identifier.
-
None of the above
C
Correct answer
Explanation
All the functions has to be defined before they are used or called.
-
Compiler
-
Program, since queue entries are overflowed
-
Stack overflow
-
Number of stacks assigned to this program crossed the maximum limit assigned to compiler
-
Symbol table over flow
D
Correct answer
Explanation
Every call to a recursive program creates a local stack of desired length. But if recursive function calls itself with in the function then another stack is crated for second call and this goes on as long as the recursive function call itself without completing it self. In the given prohram , the condition to close the recursion is not set and so the function is called endlessly. This situation has caused the error of insufficient memory, since no more space is available for new stack.
-
Bottom up
-
Operator precedence
-
Top down
-
Top up
-
Shift reduce
C
Correct answer
Explanation
Back tracking is required to find nearest root in top down parsing.
-
Postfix notations
-
Syntax tree
-
Quadrupples
-
Intermediate code is not generated at all
-
Tripples
D
Correct answer
Explanation
Single pass compiler does not generate intermediate code , since equivalent code is generated as and when the statement is scanned.
-
scanf( ) and printf( )
-
getchar( ) and printf( )
-
scanf( ) and putchar( )
-
getchar( ) and putchar( )
-
get() and put()
D
Correct answer
Explanation
Both the system defined functions are used for single character input and output respectively.
-
Float
-
Interface
-
String
-
Unsigned
-
None of these
B
Correct answer
Explanation
An interface in the Java programming language is an abstract type that is used to specify an interface (in the generic sense of the term) that classes must implement.
-
Arrow operator
-
Scope resolution operator
-
Assignment operator
-
Equality operator
-
None of these
B
Correct answer
Explanation
Scope resolution operator overloading is not possible.
-
Single error
-
Arithmetic error
-
Control logic error
-
Comparison error
A
Correct answer
Explanation
Common module errors in programming include arithmetic errors (calculation mistakes), control logic errors (flawed conditionals or loops), and comparison errors (incorrect relational operations). 'Single error' is not a standard category of programming errors - it's not a recognized type of module error.
A
Correct answer
Explanation
The INPUT statement specifically allows programs to accept user input during execution, as opposed to hardcoded values in LET statements or output-only statements like PRINT.
-
Only one
-
Two or less
-
One or more
-
INPUT statements do not accept values
C
Correct answer
Explanation
The INPUT statement can accept multiple values in a single entry. Values are separated by commas, allowing one or more data points to be entered at once.
-
the prompt to print in the next available space
-
a line to be skipped in the output
-
a question mark to appear on the screen at the end of the statement
-
an error to occur
C
Correct answer
Explanation
A semicolon after the prompt suppresses the automatic newline and causes a question mark to appear at the end of the prompt, signaling that input is expected.