230k views
5 votes
C allows the programmer to compare numeric values using:

a) .equals()
b) compareTo()
c) ==
d) isEqualTo()

User Lifeng
by
8.2k points

1 Answer

4 votes

Final answer:

In C programming, numeric values are compared using the == operator, which returns true if the values are equal and false otherwise.

Step-by-step explanation:

In the C programming language, when you want to compare numeric values to check if they are equal or not, you typically use the == operator. This operator allows you to compare two expressions and returns true if they are equal and false otherwise.

Other options like .equals() or compareTo() are methods used in object-oriented languages like Java for comparing objects, not primitve data types like in C. And isEqualTo() is not a standard operator or method in C.

Therefore, the correct answer to the question "C allows the programmer to compare numeric values using which of the following?" is c) ==.

User Nick Retallack
by
8.2k points