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
- Anything written in sizeof() is never executed in C
- Execution of printf with ++ operators
- Arrays in C/C++
- Smart Pointers in C++
- Difference between ++*p, *p++ and *++p
- Does overloading work with Inheritance?
- Object Slicing in C++
- Use of bool in C
- To find sum of two numbers without using any operator
- Sequence Points in C | Set 1
- A comma operator question
- Modulus on Negative Numbers
- C/C++ Ternary Operator - Some Interesting Observations
- Pre-increment (or pre-decrement) in C++
- Write a C macro PRINT(x) which prints x