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 modulus operator (%) can be used only with __________.






2. Allows the programmer to store a value in a variable






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






4. A program that finds and attaches to your program the indicated libraries for compilation






5. * / % + -






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






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






8. The symbol for the binary scope resolution operator






9. The sign you use for references






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






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






12. Whole numbers - no decimals and no commas included






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






14. data types that refer to numbers with decimals






15. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .






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






17. Associate an identifier with a memory location






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






19. = & | are examples of ____________.






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






21. Grammar rules of the language; compiler will try to identify and locate syntax errors






22. C++ programs are normally typed into a computer using a(n) ________ program.






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






24. All C++ Variables are_________.






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






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






27. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.






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






29. directive A statement that starts with a # is called a ____________.






30. To explicitly indicate that a value is to be converted to another type






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






32. To allow file access in a program you must #include this header file.






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






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






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






36. To write data to a file you define an object of which one of the following






37. The storage-class specifiers are mutable - auto - ________ - extern and static.






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






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






40. Symbol that denotes an action to be performed






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






42. An expression that has operands with different data types






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






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






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






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






47. In inheritance the ____________ is the class the receives the inherited members.






48. Preprocessor directive syntax






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






50. Naming convention for C++ programs