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. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')






2. The ________ statement in a called function passes the value of an expression back to the calling function.






3. For every opening brace in a C++ program there must be a ______________.






4. In inheritance the ____________ is the class that supplies the inherited members.






5. Two slash marks ( // ) indicate __________ of a comment






6. Smallest individual unit of a programming language - special symbols or word symbols or identifiers






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






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






9. Names of things that are used in a program - can apply to variables & constants and functions






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






11. You must have a ___________ for every variable you intend to use in a program






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






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






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






15. A pointer is a variable that contains as its value the____________ of another variable.






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






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






18. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.






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






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






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






22. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.






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






24. The sign you use for references






25. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.






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






27. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.






28. The elements of an array are related by the fact that they have the same name and ___________.






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






30. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.






31. A constant object must be __________; it cannot be modified after it is created.






32. The three values that can be used to initialize a pointer are 0 - __________ and an address.






33. Whole numbers - no decimals and no commas included






34. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.






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






36. An expression that has operands with different data types






37. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.






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






39. Naming convention for C++ programs






40. Every C++ statement ends with a(n) _________.






41. The stream insertion operator






42. Symbol that denotes an action to be performed






43. = & | are examples of ____________.






44. A variable declared outside any block or function is a ________ variable.






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






46. The ________ program transfers the executable image of a C++ program from disk to memory.






47. Preprocessor directive syntax






48. Used for function calls and local variables






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






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