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. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.






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






3. The ________ enables access to a global variable with the same name as a variable in the current scope.






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






5. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






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






8. Header file that contains commonly performed mathematical functions






9. A function that calls itself






10. Whole numbers - no decimals and no commas included






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






12. A file must be ________ before data can be written to or read from it.






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






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






15. A __________ data member represents class-wide information.






16. The symbol for the binary scope resolution operator






17. A variable that is known only within the function in which it is defined is called a ________.






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






19. Keyword public is a(n) _________






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






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






22. Creates a copy of a string.






23. Preprocessor directive syntax






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






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






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






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






28. You can declare default values for a function in the ____________________.






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






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






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






32. int namespace include using return examples of ___________






33. The _________ begins the body of every function and the _________ ends the body of every function.






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






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






36. This manipulator is used to establish a field width for the value immediately following it.






37. All C++ Variables are_________.






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






39. Characters used to separate symbols or reserved words or identifiers and statements






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






41. * / % + -






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






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






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






45. Class members specified as _________ are accessible anywhere an object of the class is in scope.






46. Most calculations are normally performed by ______ statements.






47. Type casting syntax






48. A member function should be declared static if it does not access __________ class members.






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






50. Default name of executable file