Saturday, 18 March 2017

C Program to check if two numbers are equal or not

C program to check if two numbers are equal or not is given below. First we take the input of both numbers and then compare them if they are equal then  numbers are equal otherwise not.


#include <stdio.h>
int main()
{
   int number1,number2;

   printf("\nEnter the number 1: ");
   scanf("%d",&number1);
   printf("\nEnter the number 2: ");
   scanf("%d",&number2);

   if(number1==number2)
   {
          printf("\nNumbers are equal");
   }
   else
   {
          printf("\nNumbers are not equal");
   }
   printf("\n");
   return 0;
}


OUTPUT:

 


EmoticonEmoticon