In C programming == is a relational operator. It returns true or false. It is used to compare the value of two variables.
If the two variables are euqual then it returns true but if it is false then it returns false.
Let’s take a look at a simple C program.
#include <stdio.h>
int main() {
int a = 4;
int b = 4;
if (a == b) {
printf("The numbers are equal.\n");
} else {
printf("The numbers are not equal.\n");
}
return 0;
}
// outut will be
// The numbers are equal