Monday, June 18, 2012

To check whether the two numbers entred by the user are equal or not


/* Program to check whether the two numbers entered by the user are equal or not */

#include<stdio.h>

#include<conio.h>

void main()

{

  int a,b;

  clrscr();

  printf("Enter any two numbers:");

  scanf("%d%d",&a,&b);

  /* Checking for equality */

  if(a==b)

    printf("\nEntered numbers are equal!");

  else

    printf("\nEntered numbers are NOT equal!");

  getch();

}

 

OUTPUT

Enter any two numbers:26

26

 

Entered numbers are equal!

 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.