Question

Which of the following types can be safely compared using the == operator? A- string b-...

Which of the following types can be safely compared using the == operator?

A- string

b- float

c- double

d- Char

2-

What will be stored in variable i after the following statement is executed?

int i = (int) Math.sqrt(5);

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Od char. the char variables are compared using operator safely. string datatype it compares reference of 2 stoings only float

Add a comment
Know the answer?
Add Answer to:
Which of the following types can be safely compared using the == operator? A- string b-...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 Given two double variables named x and y, which of the following statements could...

    QUESTION 1 Given two double variables named x and y, which of the following statements could you use to initialize both variables to a value of 0.0? a. x | y = 0.0; b. x = y = 0.0; c. x, y = 0.0; d. none of the above 1 points    QUESTION 2 When you use a range-based for loop with a vector, you a. can avoid out of bounds access b. must still use a counter variable c....

  • S. Modułus operator can operate upon A. double B、 float C. char D. int E. C...

    S. Modułus operator can operate upon A. double B、 float C. char D. int E. C and D

  • using c++ Write a C++ program which reads three values of types char, int, double and...

    using c++ Write a C++ program which reads three values of types char, int, double and string from the keyboard and primis, appropriately formatted, assigned values and variable types. For example, if letter, number, and real are variables of type char, int and double respectively, and if the values assigned to them using cin function are: a, 1, and 3.1415, then the output should be: a is a character 1 is an integen 3.1415 is a real number

  • C++ help! #4,6,7 c) no-test d) loop-test e) None of these 1. Which of the following...

    C++ help! #4,6,7 c) no-test d) loop-test e) None of these 1. Which of the following variable names is invalid? a) numstudents b) 2Darray c) studentHame d) test Grade 祁.which of the following conditions is true ifX has a value of 10 and T has a value of 20? None of these 2. In Ca4, the operator indicates: a) subtraction b) negation c) equality e) None of these . What are the final values of z and y after the...

  • c++ question 1. C++ string Class What does the output look like after executing the following...

    c++ question 1. C++ string Class What does the output look like after executing the following statements? std::string numstr = "12"; numstr += "3"; std::cout << numstr << '\n'; A. None of these. B. The snippet has syntax errors. C. 15 D.123 // 2. Let S be a class that allows integers to be stored in its objects like an array. For example, if obj is an object of S, one can write statements like obj[0] = 100; or int...

  • 2. Give the minimum size of each of the following C++ types, assuming that char values occupy one...

    2. Give the minimum size of each of the following C++ types, assuming that char values occupy one byte, short values occupy two bytes, int and float values occupy four bytes, double and long values occupy eight bytes, and pointers occupy four bytes. a) union u type ( double a[3]; int *b; char c[10] b) struct s1type float *d [2]; long e[4] char f[6] short *gi c) struct s2 type ( s1_type s; u type u [2]; int *h[3]; short...

  • 1) Which of the following is the name of a local variable in the Strange class...

    1) Which of the following is the name of a local variable in the Strange class below? public class Strange{ public static final int MAX = 5; public static void unknown(){ int number = 0; for (int i = MAX; i >= 1; i--) number += i * i; System.out.println(number); } public static void main(String[] a){ unknown(); } } a) Strange b) int c) MAX d) number e) main 2) Which of the following is NOT a method of the...

  • Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal...

    Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal '2', a string literal "2", and the numeric literal 2 are identical and stored the same way though they are different types. 3 Since comments do not affect the program execution, you don't need to have it at all. 4. After the following statements are executed, the value of the variable rem is 3. 1. A preprocessor directive line starts with a pound sign...

  • What is the output of the expression 60%3, which makes use of the modulo operator? Answer:...

    What is the output of the expression 60%3, which makes use of the modulo operator? Answer: Answer When new data are to be inserted into a data structure, but there is no available space; this situation is usually called... Select one: a. Underfow b. Overfow c. None of the above d. Saturated e. Housefull What is the output of the following program? #include <iostream> using namespace std; class Student public: double mathematics; double physics; double biology; }; int main({ Student...

  • CHAPTER 6 QUESTION 1 Which of these names follows the naming conventions for constants presented in...

    CHAPTER 6 QUESTION 1 Which of these names follows the naming conventions for constants presented in this chapter? a. WeeksInYear b. Weeks_In_Year c. weeks_in_year d. WEEKS_IN_YEAR 1 points QUESTION 2 Which of the following data types can you not use to store the value 500? a. float b. char c. int d. double 1 points QUESTION 3 What values are in the vector named pressures after the following code is executed? vector pressures; pressures.push_back(32.4); pressures.push_back(33.5); pressures.insert(pressures.begin(), 34.2); int index =...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT