Test
C++ basics: functions, variables and syntax
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (30)
11. What is the correct value to return to the operating system upon the successful completion of a program?
- AA. -1
- BB. 1
- CC. 0
- DD. Programs do not return a value.
22. What is the only function all C++ programs must contain?
- AA. start()
- BB. system()
- CC. main()
- DD. program()
33. What punctuation is used to signal the beginning and end of code blocks?
- AA. { }
- BB. -> and C. BEGIN and END
- CD. ( and )
- DC. ( )
44. What punctuation ends most lines of C++ code?
- AA. .
- BB. ;
- CC. :
- DD. '
55. Which of the following is a correct comment?
- AA. */ Comments */
- BB. ** Comment **
- CC. /* Comment */
- DD. { Comment }
66. Which of the following is not a correct variable type?
- AA. float
- BB. real
- CC. int
- DD. double
77. Which of the following is the correct operator to compare two variables?
- AA. :=
- BB. =
- CC. equal
- DD. ==
88 Reference to its own class can be accepted by
- A
A. Simple constructor - BB.Copy constructor
- C
C.Both A and B - D
D.None of the Above
- A
99 Which of the following function prototype is perfectly acceptable?
- AA. int Function(int Tmp = Show());
- BB. float Function(int Tmp = Show(int, float));
- CC. Both A and B.
- DD. float = Show(int, float) Function(Tmp);
1010 Which of the following statement is correct?
- AA. C++ enables to define functions that take constants as an argument.
- BB. We cannot change the argument of the function that that are declared as constant.
- CC. Both A and B.
- DD. We cannot use the constant while defining the function.
1111 Which of the following statement is correct?
- AA. Overloaded functions can have at most one default argument.
- BB. An overloaded function cannot have default argument.
- CC. All arguments of an overloaded function can be default.
- DD. A function if overloaded more than once cannot have default argument.
1212 Which of the following statement is correct?
- AA. Two functions having same number of argument, order and type of argument can be overloaded if both functions do not have any default argument.
- BB. Overloaded function must have default arguments.
- CC. Overloaded function must have default arguments starting from the left of argument list.
- DD. A function can be overloaded more than once.
1313 Which of the following statement will be correct if the function has three arguments passed to it?
- AA. The trailing argument will be the default argument.
- BB. The first argument will be the default argument.
- CC. The middle argument will be the default argument.
- DD. All the argument will be the default argument.
1414 Which of the following statement is incorrect?
- AA. Default arguments can be provided for pointers to functions.
- BB. A function can have all its arguments as default.
- CC. Default argument cannot be provided for pointers to functions.
- DD. Constructors can have at most five default parameters.
1515 Which of the following function / type of function cannot be overloaded?
- AA. Member function
- BB. Static function
- CC. Virtual function
- DD. Both B and C
1616. Which of the following function declaration is/are incorrect?
- AA. int Sum(int a, int b = 2, int c = 3);
- BB. int Sum(int a = 5, int b);
- CC. int Sum(int a = 0, int b, int c = 3);
- DD. Both B and C are incorrect.
1717. Which of the following statement is incorrect?
- AA. The default value for an argument can be a global constant.
- BB. The default arguments are given in the function prototype.
- CC. Compiler uses the prototype information to build a call, not the function definition.
- DD. The default arguments are given in the function prototype and should be repeated in the function definition.
1818. Where the default value of parameter have to be specified?
- AA. Function call
- BB. Function definition
- CC. Function prototype
- DD. Both B or C
1919. Which of the following statement is correct?
- AA. The default value for an argument cannot be function call.
- BB. C++ allows the redefinition of a default parameter.
- CC. Both A and B.
- DD. C++ does not allow the redefinition of a default parameter.
2020.Which of the following statement is correct?
- AA. Only one parameter of a function can be a default parameter.
- BB. Minimum one parameter of a function must be a default parameter.
- CC. All the parameters of a function can be default parameters.
- DD. No parameter of a function can be default.
2121. Which of the following statement is incorrect?
- AA. A default argument is checked for type at the time of declaration and evaluated at the time of call.
- BB. We can provide a default value to a particular argument in the middle of an argument list.
- CC. We cannot provide a default value to a particular argument in the middle of an argument list.
- DD. Default arguments are useful in situations where some arguments always have the same value.
2222. Which of the following statement is correct?
- AA. Overloaded functions can accept same number of arguments.
- BB. Overloaded functions always return value of same data type.
- CC. Overloaded functions can accept only same number and same type of arguments.
- DD. Overloaded functions can accept only different number and different type of arguments.
2323. Which of the following function / types of function cannot have default parameters?
- AA. Member function of class
- BB. main()
- CC. Member function of structure
- DD. Both B and C
2424. Which of the following statement is correct?
- AA.The order of the default argument will be right to left.
- BB. The order of the default argument will be left to right.
- CC. The order of the default argument will be alternate.
- DD. The order of the default argument will be random.
- AA.The order of the default argument will be right to left.
25Who is father of C++ Language?
- AA. Dr. E.F. Codd
- BB. James A. Gosling
- CC. Bjarne Stroustrup
- DD. Dennis Ritchie
2626. To expose a data member to the program, you must declare the data member in the _____ section of the class
- AA. Common
- BB. exposed
- CC. public
- DD. User
2727. A function that changes the state of the cout object is called a(n) _____
- AA. Member
- BB. adjuster
- CC. manipulator
- DD. operator
2828. When the compiler cannot differentiate between two overloaded constructors, they are called
- AA. Overloaded
- BB. destructed
- CC. ambiguous
- DD. dubious
2929. The file iostream includes
- AA. The declarations of the basic standard input-output library
- BB. The streams of includes and outputs of program effect
- CC. Both of these
- DD. None of these
3030. The most common operation used in constructors is
- AA. addition
- BB. overloading
- CC. assignment
- DD. polymorphism
Información
- Descripción
- Test sobre Sin título, creado por kamen__14 el 29/04/2015.
- Autor
- kamen__14
- Idioma
- English
- Visitas
- 0
- Valoración
- Aún sin valoraciones Valora este test
Más sobre C++ Programming Basics