check if two variable is not equal in C
Code snippet on how to check if two variable is not equal in C
if (variable1 != variable2){
printf("The variables are not equal");
}
This code checks if two variables declared in the if
statement are not equal to each other. The !=
operator is used to compare them. If the variables are not equal, a statement is printed out stating “The variables are not equal.” On the other hand, if the variables are equal, no statement is printed out.