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
More Stories
Notice: Trying to access array offset on value of type bool in /hermes/bosnacweb05/bosnacweb05bi/b2282/ipg.jbbuidtech37209/timecomputers/wp-content/themes/enternews/inc/template-functions.php on line 601
C tutorial in telugu about Strings Part 36
Notice: Trying to access array offset on value of type bool in /hermes/bosnacweb05/bosnacweb05bi/b2282/ipg.jbbuidtech37209/timecomputers/wp-content/themes/enternews/inc/template-functions.php on line 601
C language tutorial in telugu free download Part 35
Notice: Trying to access array offset on value of type bool in /hermes/bosnacweb05/bosnacweb05bi/b2282/ipg.jbbuidtech37209/timecomputers/wp-content/themes/enternews/inc/template-functions.php on line 601
How to learn c programming in telugu Strings example2 part 34