C Programming Code Examples C > If Else and Switch Case Code Examples C Program to Accept two Integers and Check if they are Equal C Program to Accept two Integers and Check if they are Equal This program accepts two integers and check if they are equal or not. - Take the two integers as input. - Using if,else statements check if they are equal or not. - Print the output accordingly and exit. #include <stdio.h> void main() { int x, y; printf("Enter the values for x and y\n"); scanf("%d %d", &x, &y); if (x == y) printf("x and y are equal\n"); else printf("x and y are not equal\n"); } Take the two integers as input and store it in the variables x and y respectively. Using if,else statements check if x is equal to y. If they are equal, then print the output as "x and y are equal". Otherwise print it as "x and y are not equal".