What is the purpose of a relational operator in C++?
A. It is used with pointers to access addresses.
B. It is needed to do comparisons between variables.
C. The cout statement must have relational operator(s).
D. The program uses it to assign values to variables.
B
Computer Science & Information Technology
You might also like to view...
Describe the role of a resource manager.
What will be an ideal response?
Computer Science & Information Technology
The following code should add integers from two TextBoxes and display the result in txtResult. Assume that intValue1 and intValue2 are declared as ints. Find the error(s) in the following code:
try { intValue1 = Int32.Parse( txtInput1.Text ); intValue2 = Int32.Parse( txtInput2.Text ); txtOutput.Text = Convert.ToString( intValue1 + intValue2 ); catch ( ) { MessageBox.Show( "Please enter valid ints.", "Invalid Number Format", MessageBoxButtons.OK, MessageBoxIcon.Error ); } }
Computer Science & Information Technology