Monday, 23 February 2015

Logical Operator in C


#include<stdio.h>
#include<conio.h>
main()
{
int a=10,b=5;
clrscr();
printf("\n a>15 && a<5 :%d",(a>15&&a<5));
printf("\n a>5  &&  a<5 :%d",(a>5&&a<5));
printf("\n a>15 && a<15 :%d",(a>15&&a<15));
printf("\n a>5  && a<15 :%d",(a>5&&a<15));

printf("\n a>15 || a<5 :%d",(a>15||a<5));
printf("\n a>5  || a<5 :%d",(a>5||a<5));
printf("\n a>15 || a<15 :%d",(a>15||a<15));
printf("\n a>5  || a<15 :%d",(a>5||a<15));

printf("\n !(a>b) :%d",!(a>b));
printf("\n !(a<b) :%d",!(a<b));

getch();
}


No comments:

Post a Comment