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
- How to check whether a number is in the range[low, high] using one comparison ?
- Comparison of boolean data type in C++ and Java
- 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,
- Chain of Pointers in C with Examples
- Pointer Expressions in C with Examples