To test two expressions for equality, use == instead of = : Equality « Data Type « C Tutorial






#include <stdio.h>

main(){
  int i = 5;
  if(i == 5){
     printf(" ==. \n");
  }
  if(i=4){
     printf("do not use = ");
  }
}
==.
     do not use =








2.29.Equality
2.29.1.Comparing the equality operator (==) with the '=' assignment operator.
2.29.2.To test two expressions for equality, use == instead of =