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 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.
  1. /*
  2.  * C program to accept two integers and check if they are equal
  3.  */
  4. #include <stdio.h>
  5. void main()
  6. {
  7.     int m, n;
  8.  
  9.     printf("Enter the values for M and N\n");
  10.     scanf("%d %d", &m, &n);
  11.     if (m == n)
  12.         printf("M and N are equal\n");
  13.     else
  14.         printf("M and N are not equal\n");
  15. }
$ 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

No comments:

hia friends you are seeing my blogger thank's. Powered by Blogger.