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
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- 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 Java with other programming languages
- Comparison of Python with Other Programming Languages
- Comparison of static keyword in C++ and Java
- Comparison of Exception Handling in C++ and Java
- Assigning an integer to float and comparison in C/C++
- 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,
- Strict Aliasing Rule in C with Examples