In C, data type of result of comparison operations is int. For example, see the following program.
Whereas in C++, type of results of comparison operations is bool. For example, see the following program.
This article is contributed by Rajat. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- Write a program that produces different results in C and C++
- Comparison of a float with a value in C
- Ratio Manipulations in C++ | Set 2 (Comparison)
- Comparison of static keyword in C++ and Java
- Comparison of Java with other programming languages
- Assigning an integer to float and comparison in C/C++
- Comparison of Exception Handling in C++ and Java
- Comparison of boolean data type in C++ and Java
- How to check whether a number is in the range[low, high] using one comparison ?
- Operations on struct variables in C
- Floating Point Operations & Associativity in C, C++ and Java
- Merge operations using STL in C++ | merge(), includes(), set_union(), set_intersection(), set_difference(), ., inplace_merge,
- Dividing a Large file into Separate Modules in C/C++, Java and Python
- How to delete a range of values from the List using Iterator