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
-
float a[+40]
-
int num[1-10]
-
double[50]
-
float values[10]
D
Correct answer
Explanation
This option is correct as this declaration of array is valid.
-
Total time of execution will be 10 milli seconds.
-
The total time of execution will be 10 seconds.
-
Total time of execution will be 40 seconds.
-
None of the above
C
Correct answer
Explanation
This option is correct because the execution time of one loop is 10 seconds and since the loop runs 4 times, hence the total time of program execution will be 40 seconds.
-
Variable
-
Looping structure
-
Preprocessor directive
-
None of these
C
Correct answer
Explanation
A preprocessor directive statement always begins with '#' symbol in 'C'.
-
While loop
-
For loop
-
Do-While loop
-
None of these
B
Correct answer
Explanation
This looping structure executes a block of instruction for the specified number of time.
-
sequence structure
-
selection structure
-
iteration structure
-
none of these
B
Correct answer
Explanation
'Switch-Case' statement comes under the selection structure as it allows the user to select appropriate case statement depending upon the choice of the user.
-
fgets()
-
getc()
-
putc()
-
none of these
C
Correct answer
Explanation
This function is used in 'C' to write a single character into an output file.
-
Label
-
Comment
-
Delimiter
-
None of these
C
Correct answer
Explanation
Delimiter is also called as separator in 'C', used to separate literals, variables, statements, etc.
-
Compiler
-
Interpreter
-
Converter
-
Translator
-
None of the above
B
Correct answer
Explanation
An interpreter is a program that reads and executes code. This includes source code, pre-compiled code, and scripts and it can execute an statement at one time .
-
the hour of the Date object from 1 - 24
-
the minute of the Date object
-
the hour of the Date object from 0 - 11
-
the hour of the Date object from 0 - 23
-
the hour of the Date object from 1 - 12
D
Correct answer
Explanation
This is the correct answer.
-
int
-
main
-
if
-
printf
-
struct
D
Correct answer
Explanation
printf is not a reserved word in C. It is a function defined under stdio.h.
-
Syntax errors
-
Semantic errors
-
Logical errors
-
Internal errors
-
_
A
Correct answer
Explanation
It is an error in the syntax of a sequence of characters that is intended to be written in a particular programming language. Syntax errors occur during the parsing of input code and are caused by grammatically incorrect statements.
-
Char
-
Number
-
Float
-
Double
-
Integer
D
Correct answer
Explanation
It gives the highest decimal precision, which increases the accuarcy of the calculation of large numbers.
-
similar datatype only
-
dissimilar datatype only
-
integer datatype only
-
string datatype only
-
all datatypes
E
Correct answer
Explanation
Structure can use any type of data type within it and the new data type is called structure data type.
-
return
-
goto
-
continue
-
break
-
jump
C
Correct answer
Explanation
continue is the correct command used to skip rest of the statements below it and continue the loop from beginning, if condition is met.
-
It points to allocated memory.
-
It points to freed or deallocated memory.
-
It points to pointer.
-
It points to variables.
-
It points to register variables.
B
Correct answer
Explanation
Dangling pointer points to deallocated memory.