/*Program to Understand Logical And operator :*/
#include<stdio.h>#include<conio.h>
int main()
{
printf("Logical AND Operator Result : \n");
printf(" 0 && 0 = %d \n",0&&0);
printf(" 1 && 0 = %d \n",1&&0);
printf(" 0 && 1 = %d \n",0&&1);
printf(" 1 && 1 = %d \n",1&&1);
return 0;
}
output
0 && 0 = 01 && 0 = 0
0 && 1 = 0
1 && 1 = 1
C program explaining Logical OR ( || ) Operator With Example and Truth table
/*Logical OR ( || ) Operator With Example and Truth table :*/
#include<stdio.h>#include<conio.h>
int main()
{
printf("Logical OR Operator Result : \n");
printf(" 0 || 0 = %d \n",0||0);
printf(" 1 || 0 = %d \n",1||0);
printf(" 0 || 1 = %d \n",0||1);
printf(" 1 || 1 = %d \n",1||1);
return 0;
}
output
0 || 0 = 01 || 0 = 1
0 || 1 = 1
1 || 1 = 1
Comments
Post a Comment