February 23, 2025

Telugu Tech Tuts

TimeComputers.in

C In Telugu C Notes in telugu Relational Operators Part 11

Example

#include
#include
void main()
{
int a = 21;
int b = 10;
int c ;

if( a == b )
{
printf(“Line 1 – a is equal to bn” );
}
else
{
printf(“Line 1 – a is not equal to bn” );
}
if ( a < b ) { printf("Line 2 - a is less than bn" ); } else { printf("Line 2 - a is not less than bn" ); } if ( a > b )
{
printf(“Line 3 – a is greater than bn” );
}
else
{
printf(“Line 3 – a is not greater than bn” );
}
/* Lets change value of a and b */
a = 5;
b = 20;
if ( a <= b ) { printf("Line 4 - a is either less than or equal to bn" ); } if ( b >= a )
{
printf(“Line 5 – b is either greater than or equal to bn” );
}
}

When you compile and execute the above program it produces the following result:

Line 1 – a is not equal to b
Line 2 – a is not less than b
Line 3 – a is greater than b
Line 4 – a is either less than or equal to b
Line 5 – b is either greater than or equal to b