- Program :
#include <stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f;
clrscr();
printf("\n----------------LOGICAL OPERATORS----------------");
printf("\nEnter any three values:");
scanf("%d%d%d",&a,&b,&c);
printf("\n----------------LOGICAL OPERATOR(&&)----------------");
d=(a==b)&&(c>b);
printf("\nLogical AND is : %d",d);
printf("\n----------------LOGICAL OPERATOR(||)----------------");
e=(a==b)||(c<b);
printf("\nLogical OR is : %d",e);
printf("\n----------------LOGICAL OPERATOR(!=)----------------");
f=!(a==b);
printf("\nLogical NOT is : %d",f);
getch();
}
- Output :
No comments:
Post a Comment