Test Series - cpp

Test Number 76/102

Q: Which header file is required to use complex class in your program?
A. 
B. 
C. 
D. 
Solution:  header file is required to use the functionalitites of complex numbers.
Q: Which of the following is the correct syntax of declaring a complex number?
A. complex variable_name;
B. complex variable_name;
C. Complex variable_name;
D. Complex variable_name;
Solution: The correct syntax of declaring a complex number object is complex variable_name.
Q: Which function is used to get the real part of the complex number?
A. img_p()
B. imag_p()
C. real()
D. real_p()
Solution: The real() function is provided by the complex 
to access the real part of a complex number object.
Q: Which function is used to get the imaginary part of the complex number?
A. real()
B. imag()
C. imag_p()
D. real_p()
Solution: The imag() function is provided by the complex 
to access the imaginary part of a complex number object.
Q: Which function is used to get the absolute of a complex number?
A. ret()
B. norm()
C. mod()
D. abs()
Solution: abs() function is provided by the header to calculate the absolute value of a complex number.
Q: Which function is used to get the argument of a complex number?
A. abs()
B. norm()
C. arg()
D. argu()
Solution: The argument of a complex is calculated using the arg() function of the  header.
Q: What is the use of polar function?
A. Used to construct a complex number from the real and imaginary part
B. Used to construct a complex number from magnitude and phase angle
C. Used to construct a complex number from the magnitude and real part
D. Used to construct a complex number from argument and phase angle
Solution: The polar() function of a complex header is used to construct the complex number using the magnitude and phase angle.
Q: Which function is used to calculate the norm of a complex number?
A. abs()
B. norm()
C. mod()
D. square_sum()
Solution:  header provides norm() function to calculate the norm of a complex number.
Q: Which function is used to calculate the conjugate of a complex number?
A. conj()
B. reverse()
C. opp()
D. find_conj()
Solution:  header provides conj() function to calculate the conjugate of a complex number.
Q: What is the use of proj() function?
A. Used to calculate the argument of a complex number
B. Used to calculate the conjugate of a complex number
C. Used to calculate the negative of a complex number
D. Used to calculate the projection of a complex number
Solution:  header provides proj() function to calculate the projection of a complex number a + ib.

You Have Score    /10