06 C Program to Accept two Integers and Check if they are Equal
Posted by Superadmin on December 21 2015 17:15:38
This C Program accepts two integers and check if they are equal. The program accepts 2 integer values, checks whether 2 value are equal or not. If the 2 values are equal, display they are equal.
Here is source code of the C program to accepts two integers and check if they are equal. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
/*
* C program to accept two integers and check if they are equal
*/
#include
void main()
{
int m, n;
printf("Enter the values for M and N\n");
scanf("%d %d", &m, &n);
if (m == n)
printf("M and N are equal\n");
else
printf("M and N are not equal\n");
}
$ cc pgm74.c
$ a.out
Enter the values for M and N
3 3
M and N are equal
$ a.out
Enter the values for M and N
5 8
M and N are not equal