Do you think operator < is faster than <= in C/C++?

No, the operator < takes same time to execute as operator <= takes. Both operators execute similarly and take same execution time to perform the execution of instructions.

There is a jcc( jump instruction) at the time of compilation and depending upon the type of comparison, it jumps to the instructions. The following are some of the comparison type −

  • je − Jump if equal

  • jg − Jump if greater

  • jne − Jump if not equal

  • jge − Jump if greater or equal

There is only one difference between operator < and operator <= that the operator < executes ‘jg’ instruction while the operator <= executes ‘jge’ instruction. But both operators take same time to execute.

Here is an example of operator < and <= in C language,


 Live Demo

int main() {
   int a = 8;
   int b = 8;

   printf("b is greater than a\n");

   printf("b is greater or equal to a");
   printf("b is smaller than a");
   return 0;


Here is the output

b is greater or equal to a

Updated on: 25-Jun-2020


Kickstart Your Career

Get certified by completing the course

Get Started