Explore topic-wise MCQs in C++ Programming.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

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
Answer» C. Used to construct a complex number from the magnitude and real part
2.

Which function is used to get the argument of a complex number?

A. abs()
B. norm()
C. arg()
D. argu()
Answer» D. argu()
3.

Which function is used to get the absolute of a complex number?

A. ret()
B. norm()
C. mod()
D. abs()
Answer» E.
4.

Which function is used to get the imaginary part of the complex number?

A. real()
B. imag()
C. imag_p()
D. real_p()
Answer» C. imag_p()
5.

Which function is used to get the real part of the complex number?

A. img_p()
B. imag_p()
C. real()
D. real_p()
Answer» D. real_p()
6.

Which of the following is the correct syntax of declaring a complex number?

A. complex variable_name<type>;
B. complex<type> variable_name;
C. Complex<type> variable_name;
D. Complex variable_name<type>;
Answer» C. Complex<type> variable_name;
7.

Which header file is required to use complex class in your program?

A. <complex>
B. <math>
C. <complex_math>
D. <algorithm>
Answer» B. <math>