Pages

Saturday, 20 June 2020

Difference between = and == operator C Language

Difference between = and == operator C Language

Assignment Operator

= is an assignment operator which transfer right  hand variable value to left hand side variable with over right mode.


int i=1,j=2;


Equality operator (==)

== is used to compare two variable. If both variables are true its return positive number to denote true otherwise 0 or negative number to denote false.
int i=1,j=2;
     if (i == j)
          puts("True");
     else
          puts("False");

No comments:

Post a Comment