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. The conditional operator. it evaluates a line of code and returns one thing if the condition is true and a different thing if the condition is false.






2. newline






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






4. An expression that has operands with different data types






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






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






7. Function ________ is used to produce random numbers.






8. This manipulator causes the field to be left-justified with padding spaces printed to the right.






9. Words that are used for special purposes in a program






10. A type of pointer that can point at objects of any data type.






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






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






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






14. A __________ should be used to declare the size of an array because it makes the program more scalable.






15. Compares two strings and returns 0 if they are equal.






16. Use 2 characters to represent one






17. Operator with only one operand






18. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors






19. Sets floating-point values to a fixed decimal format






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






21. These are data items whose values do not change while the program is running






22. If a member initializer is not provided for a member object of a class the object's __________ is called.






23. A C++ statement that makes a decision is ______.






24. The process of placing the elements of an array in order is called ________ the array.






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






26. All C++ Variables are_________.






27. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.






28. Class members are accessed via the ________ operator in conjunction with the name of an object (or reference to an object) of the class or via the arrow (->) operator in conjunction with a pointer to an object of the class.






29. When it is not known in advance how many times a set of statements will be repeated a _________value can be used to terminate the repetition.






30. Nonexecutable statements that are included in a program to provide information about what the program does etc.






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






32. The address-of operator. it is used to assign pointers and to print the address of variables.






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






34. data types that refer to numbers with decimals






35. Associate an identifier with a memory location






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






37. The sign you use for references






38. The symbol for the binary scope resolution operator






39. Identifier or expression that is part of the calculation to be performed






40. Syntax for named constant declaration






41. 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.






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






43. The __________ operator reclaims memory previously allocated by new.






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






45. A filestream variable that represents the default input source






46. A function is invoked with a ________.






47. The stream extraction operator






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






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






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