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
B
Correct answer
Explanation
This was not included when C++ was standardized in 1999.
-
There is no problem in the above statement.
-
Because the second argument is a character.
-
Because the first argument is of type char*.
-
The strcat declaration also takes length of string as an argument.
B
Correct answer
Explanation
The string function strcat( ) concatenates strings and not a character.
-
The,cstdio
-
The.cstring
-
The,cstdlib
-
The,iostream
C
Correct answer
Explanation
This macro expands to a system-dependent integral expression that, when used as the argument for function exit should signify that the application was successful. It is defined in header cstdlib.
C
Correct answer
Explanation
The char, int, float, double and void are five data types defined by C. In C++ , add two more- bool and wchar_t. Hence, bool is the correct option.
D
Correct answer
Explanation
The pow is used to calculate the result of base raised to power exponent and is defined in math.h.
C
Correct answer
Explanation
Tolower is defined in ctype.h. Hence, it is the correct answer.
-
nose
-
back
-
ear
-
None of these
A
Correct answer
Explanation
In LOGO turtle graphics, the turtle is an isosceles triangle. The pointed vertex that indicates the direction of movement is called the nose.
-
Inline functions
-
Constructors
-
Destructors
-
None of the above
A
Correct answer
Explanation
Inline functions are very useful when we need to create efficient code as their code is expanded each time they are invoked. Inline functions are preceded by inline keyword. For example: inline int findlarge(int x, int y) {return x > y ? x : y;}. Hence, this is the correct answer.
-
cin
-
cout
-
cerr
-
none of the above
D
Correct answer
Explanation
Clog is a built-in stream that refers to the buffered version of cerr.
The above given four options are built in streams. Hence, this is the correct option.
-
Function declaration is correct.
-
Parameter cannot be given default value in function declaration.
-
All parameters that take default value, must appear to right of those that do not.
-
Default argument of parameter cannot be zero.
C
Correct answer
Explanation
This option is correct as the only problem with the above function declaration is that a is intialized, but b is not. However, if a is intialized then b should also be initialized as explained in above option.
-
dynamic_cast
-
static_cast
-
const_cast
-
reinterpret_cast
C
Correct answer
Explanation
The const_cast is used explicitly override const and/or volatile attribute of variable. Hence, this is the correct answer.
D
Correct answer
Explanation
In C++, there is no finally keyword, which is defined in Java. Hence, this is the correct answer.
-
Inline
-
Continue
-
Return
-
Overload
D
Correct answer
Explanation
Overload keyword is now obsolete and is no longer used or supported. It is not a part of Standard C++. It was preceded with function name in its definition to indicate that it was an overloaded function. Hence, this is the correct answer.
-
Assembly name
-
Delegate
-
Set accessor
-
Continue
-
Private
B
Correct answer
Explanation
It is equivalent to a type safe function pointer or a callback.
-
Break
-
Continue
-
If
-
Switch
-
Private
A
Correct answer
Explanation
This statements terminates the closest enclosing loop or switch statement in which it appears.