1. What function initalizes variables in a class: Constructor Destructor Constitutor A and B are correct. 2.

To include code from the library in the program, such as iostream, a directiv e would be called up using this command. #include <>; with iostream.h inside the brackets include (iostreamh) #include <> with iostream.h inside the brackets include #iostream,h; 3. Single line comments explaining code would be preceded like in the following example /** // *// /* 4. Which line has all reserved words ? char, int, float, doubled, short, long, unsigned, signed sizeof, const, typedef, static, voided, enum, struct, union if, else, for, while do, switch, continue, break defaulted, goto, return, extern, private, public, protected 5. What punctuation must each command line have at the end of the line ? : , ! ; 6. The C++ language is case-sensitive. Not case-sensitive. It depends None of these 7. The number 5.9875e17 must be stored in a(n): int long double float 8. Select the correct definition for a string variable. string mystr; string mystr[20]; string[20] mystr; char mystr[20]; 9. The sentence "Hello world!" uses _____ elements in a character array.

c++) 0. cout << "Hello World\n". .10 11 12 13 10. you need to use the following keyword structure struct object record 11. Select the correct function definition (NOT prototype) from the list below. Write a for loop that counts from 0 to 5. cout << "Hello \n World". c++) c = 0. for for for for (c = (int (c = (c = 0. "\n". Cout can print multiple values or variables in a single command using the fo llowing syntax: cout cout cout cout << << << << "Hi" + bob + "\n". 13. c <= 6. "Hi". bool int real double 17. int pow). c++). ("Hi" & bob & "\n"). c <= 5. 12. c < 5. 14. c++) 0. What does the statement #include do ? It It It It defines the function iostream. double sin(double rad). Which one of the choices would produce the following output ? cout << "Hello" << "World". c < 5. Which of the following converts an integer "value" to its ASCII equivalent ? atoi(value) cout << value (char) value char (value) 16. When you are creating a structure. void intro(). bob. int foo(int bar. Indicate which data type is not part of standard C++.h tells the compiler where the program begins defines the words TRUE and FALSE allows the programmer to use cout << It defines the statement return 15. "Hi" << bob << "\n". double baz) double pow(double num.

22 12 error 23 20. cout << a. For which values of the integer _value will the following code become an inf inite loop? int number=1. number += _value. 18. i++). i<10. What is the output of the following code? for (int i=0. a <= 1. } only only only only 0 1 2 1 or 2 . while (true) { cout << number. What is the output of the following code? for (int a = 1. cout << i%2 << " ".cin >> "Hello World". a++) cout << a++. if (number == 3) break. } 0 0 1 0 1 2 0 1 2 4 1 0 3 6 0 1 4 8 1 0 5 6 7 10 12 0 1 0 1 0 1 8 9 14 16 18 1 0 0 1 19.

Sign up to vote on this title
UsefulNot useful