Test your basic knowledge |

C++ Programming Basics

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. A member function should be declared static if it does not access __________ class members.






2. A________ allows the compiler to check the number & types and order of the arguments passed to a function.






3. A sequence of operands and operators that describe a calculation to be performed






4. Program components in C++ are called functions and ________.






5. __________ can be used to assign an object of a class to another object of the same class.






6. The escape sequence ___ when output with cout and the stream insertion operator - causes the cursor to position to the beginning of the next line on the screen.






7. Class members specified as _________ are accessible only to member functions of the class and friends of the class.






8. Used for dynamically allocated variables






9. Operator with only one operand






10. All ______ must be declared before they are used.






11. A function that calls itself either directly or indirectly - through another function) - is a ________ function.






12. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.






13. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.






14. The _____ causes the contents of another file to be inserted into a program.






15. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution






16. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.






17. The idea that you can call the same function and the output will depend on the type of object you're using.






18. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.






19. Type casting syntax






20. A set of values together with a set of operations






21. The modulus operator (%) can be used only with __________.






22. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time






23. A human readable file that contains C++ program






24. A function is invoked with a ________.






25. Associate an identifier with a memory location






26. The only integer that can be assigned directly to a pointer is_____________.






27. The ________ of an identifier is the portion of the program in which the identifier can be used.






28. The size & shape & color and weight of an object are considered






29. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.






30. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call






31. An array that uses two subscripts is referred to as a(n) _________ array.






32. Creates a copy of a string.






33. This is used to mark the end of a complete C++ programming statement.






34. Returns the length of a string excluding the null terminator.






35. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.






36. The ________ program combines the output of the compiler with various library functions to produce an executable image.






37. A filestream variable that represents the default input source






38. Initializers __________ must be used to initialize constant members of a class.






39. An expression that has operands with different data types






40. The ________ qualifier is used to declare read-only variables.






41. A function ________ enables a single function to be defined to perform a task on many different data types.






42. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.






43. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.






44. Every C++ program begins execution at the function _________.






45. Symbol that denotes an action to be performed






46. An operator that can only be used with int values. result will always be an int.






47. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')






48. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.






49. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.






50. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.