Programming - C++ Language

You Are Here :: Home > C++ Language > Functions - General Questions

 
1.

A function that returns no values to the program that calls it is _____                        


A. not allowed in C++ B. type void
C. type empty D. type barren




2.

A function that returns no values to the program that calls it is _____                        


A. not allowed in C++ B. type void
C. type empty D. type barren




3.

The function call below is designed to return, in variable result, the product of x and y. All the variables are of type int. What is the correct prototype for such a function?
myFunction(&result, &x, &y);                        


A. void myFunction(int, int, int) ; B. void myFunction(int *, int *, int *) ;
C. void myFunction(const int *, const int *, const int *) ; D. void myFunction(int *, const int *, const int *) ;




4.

The function call below is designed to return, in variable result, the product of x and y. All the variables are of type int. What is the correct prototype for such a function?
myFunction(result, x, y);                        


A. void myFunction(int &, int, int) ; B. void myFunction(int, int, int) ;
C. void myFunction(const int *, const int, const int) ; D. void myFunction(int *, const int *, const int *) ;




5.

Identify the correct prototype for a function that receives an array of doubles, computes the sum of all the elements of the array, and returns the sum to the calling function.                        


A. void computeSum(double array[], int size, double * sum); B. void computeSum(double array[], int size, double & sum);
C. double computeSum(double array[], int size); D. All of the Above




6.

Every function in C++ are followed by                        


A. Parameters B. Parenthesis
C. Curly braces D. None of these




1

2

3

4

5

next »

 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on