-
Notifications
You must be signed in to change notification settings - Fork 7
/
RelationalOperators.c
47 lines (39 loc) · 977 Bytes
/
RelationalOperators.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Relational operators in c language
#include<stdio.h>
int main()
{
int a, b;
printf("Enter two numbers a and b respectively\n");
scanf("%d%d",&a,&b);
// Greater than operator
if (a>b)
printf("a is greater than b\n");
else
printf("a is smaller than b\n");
// Greater than equal to
if (a>=b)
printf("a is greater than equal to b\n");
else
printf("a is not greater than equal to b\n");
//Less than
if (a<b)
printf("a is less than b\n");
else
printf("a is greater than b\n");
//Lesser than equal to
if (a<=b)
printf("a is less than equal to b\n");
else
printf("a is greater than equal to b\n");
//equal to
if (a==b)
printf("a is equal to b\n");
else
printf("a is not equal to b\n");
//not equal to
if (a!=b)
printf("a is not equal to b\n");
else
printf("a is equal to b\n");
return 0;
}