Thursday, June 16, 2016

C Program to demonstrate use of relational operators.

// Relational operators are <  >  ==  !=  >=  <=
#include<stdio.h>
void main()
{
int a, b;

printf("Enter number A:");
scanf("%d",&a);

printf("Enter number B:");
scanf("%d",&b);

if(a > b)
{
printf("Value of A is greater than B.");
}
else
{
printf("Value of A is not greater than B.");
}
}
//Output
Enter number A:5
Enter number B:3
Value of A is greater than B.

No comments:

Post a Comment