Mansi wants to write a program to compare two values which are not equal suggest 3rd the operator which displays the known equality between two operands
Answers
Following are the program in C langauge
#include <stdio.h> // header file
int main()
{
int a,b; // variable declaration
printf("Enter the number:\n");
scanf("%d%d",&a,&b); // Read the number
if(a!=b) // check the condition
{
printf(" number are not equal");
}
else
{
printf(" number are equal:");
}
return 0;
}
Output:
Enter the number:
34
45
number are not equal
Explanation:
Following are the description of Program
Read the value of variable "a" and "b" by the user by scanf function .
Used != operator inside the if statement to check whether number are equal or not.
If the condition inside the if block is true then statement inside if block will be executed otherwise the statement inside the else block will be executed .