# data[].attributes.body
#include <stdio.h>

int main()
{
int a = 1;
int b = 0;

if (a == 1 && b == 1) printf("a is 1 AND b is 1\n");
else if (a == 1 && b == 0) printf("a is 1 AND b is 0\n");
else  printf("Neither condition is true for logical AND\n");
return 0;
}

Output:
a is 1 AND b is 0

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
Void main()
{
int a=5,b=5,c=10,value;
clrscr();
value=(a==b)&&(c>b);
printf("(a==b)&&(c>b) is %d",value);
value=(a==b)||(c<b);
printf("(a==b)||(c<b) is %d",value);
value=!(a==b);
printf("!(a==b) is %d",value);
getch();
}
Output
(a==b)&&(c>b) is 1
(a==b)||(c<b) is 1
!(a==b) is 0

# data[].attributes.body
I/P
#include<stdio.h>
#include<conio.h>
int main()
{
int a=0;
int b=1;
printf("%d\n",a&&b);
printf("%d\n",a||b);
printf("%d\n",a!=b);
printf("%d\n",a^b);
return 0;
}
O/P
0
1
1
1

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b;
printf("enter the a and b:");
scanf("%d %d",&a,&b);
printf("%d",a&&b);
printf("%d",a||b);
printf("%d",a==b);
printf("%d",a!=b);
getch();
return 0;
}

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
int main(){
int a=60;
int b=61;
printf(a && b);
printf(a||b);
printf(a!=b);
return 0;
}

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b;
printf("Enter the first value:");
scanf("%d",&a);
printf("Enter the  second value:");
scanf("%d",&b);

printf("%d",a&&b);
printf("\n%d",a||b);
printf("\n%d,a!=b);

return 0;
}

Output:

Enter the first value:16
Enter the second value:61
1
1
1

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
int main()
{
int a=10,b=20;
clrscr();
if(a>0 && b>0)
{ printf("%d and %d are greater than 0",a,b);}
getch();
return 0;
}
O/P:
10 and 20 are greater than 0

# data[].attributes.body
#include <stdio.h>
int main ()
{
 for (int i=0 ;i<=20;i++)
  {
    if (i%2 ==0){ printf("%i \n",i);}
  }
}

# data[].attributes.body
#include <studio.h>
int main()
{
int a,b;
Printf("Enter the no:");
Scanf("%d%d",&a&b);
Printf("%d",a&&b);
Printf("%d",a||b);
if(a>b);
{
Printf("\n A is greater than B:%d",a );
else;
{
Printf("\n A is less than B:%d,b);
}
return 0;
}
Return 0;
}

# data[].attributes.body
#include<stdio.h>
int main()
{
int a, b;
printf("enter a and b");
scanf("\n%d \n%d", &a, &b);
printf("%d", a>b && b<a);
}

enter a and b
2
1
1
[Process completed - press Enter]

# data[].attributes.body
#include <stdio.h>
int main()
{
int a,b;
printf("Enter the Numbers:");
scanf("%d%d",&a,&b);
printf("And:%d\nOr:%d\nNot:%d",a>0&&b<0,a>0||b<0,!a);
return 0;
}

# data[].attributes.body
#include<studio.h>
void main()
{
int a=0,b=1;
printf("or %d \n and %d ",a||b,a&&b);
}

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
printf("Enter Mark : ");
scanf("%d",&i);
if((i>90)&&(i<=100))
{
printf("A Grade");
}
else if((i>80)&&(i<=90))
{
printf("B Grade");
}
else if((i>70)&&(i<=80))
{
printf("C Grade");
}
else
{
printf("No Grade");
}
getch();
}

# data[].attributes.body
//Logical operators

#include <stdio.h>
int main()
{
int a = 5, b = 5, c = 10, result;

result = (a == b) && (c > b);
printf("(a == b) && (c > b) is %d \n", result);

result = (a == b) && (c < b);
printf("(a == b) && (c < b) is %d \n", result);

result = (a == b) || (c < b);
printf("(a == b) || (c < b) is %d \n", result);

result = (a != b) || (c < b);
printf("(a != b) || (c < b) is %d \n", result);

result = !(a != b);
printf("!(a != b) is %d \n", result);

result = !(a == b);
printf("!(a == b) is %d \n", result);

return 0;
}

# data[].attributes.body
#include<stdio.h>
void main)
int a, b;
printf("Enter values for a and b: ");
scanf("%d %d", &a, &b);
printf(" %d".(a<b)&&(al=b));
printf(" %d".(a<b)||(b<a));
printf(" %d"!(a==b));

# data[].attributes.body
#include<stdio.h>
int main()
{
int a , b , c ;
Printf("Enter two numbers : ");
Scanf("%d %d ",&a,&b);
C = (a == b) && (c > b) ;
printf("(a == b) && (c > b) is : %d",c);
return 0;
}

# data[].attributes.body
#include <studio.h>
int main()
{
int a;
printf("Enter the value of a :\n");
scanf("%d\n",&a);
if(a==30 && a<=10)
{
printf("a is less than 10");
}
else if (a==50 || a<=100)
{
printf("a is less than 100;")
}
else
{
printf("None");
}

# data[].attributes.body
#include <stdio.h>
int main()
{
int a,b;
printf("enter the value1:");
scanf("%d",&a);
printf("\nenter the value2:");

scanf("%d",&b);
printf("\nthe logical and = %d",a&&b);
printf("\nthe logical or =%d",a||b);
printf("\nthe logical not =%d",a!=b);
return 0;
}

Output :
enter the value1:0
enter the value2:1
the logical and = 0
the logical or =1
the logical not =1

# data[].attributes.body
#include <studio.h>
int main()
{
int a,b;
printf(“Enter the value:”);
scanf(“%d%d”,&a&b be);
if(a>b);
printf(“The value is %d”,a);
if(b>a);
printf(“The value is %d”,b);
return(0);
}

# data[].attributes.body
Program:
#include <stdio.h>
#include <conio.h>
int main()
{
int a=0,b=1;
printf("AND(a&&b): %d",a&&b);
printf("\nNOR(a||b): %d",a||b);
printf("\nNOT(!(a==b)): %d",!(a==b));
printf("\nXOR(a^b): %d",(a^b));
return 0;
}
Output:
AND(a&&b): 0
NOR(a||b): 1
NOT(!(a==b)): 1
XOR(a^b): 1

# data[].attributes.body
#include<stdio.h>
Int main()
{
Int a=10,b=5;
Printf(“%d %d %d “,a>10 &&b<4,a>15||b<2,a!=b);

}
O/p: 0,1,1

# data[].attributes.body
Lakshmi

# data[].attributes.body
#include<stdio.h>
int main()
{
int a=2,b=9;
if ((a>0) || (b>0)){
printf("hi io");
}
}

# data[].attributes.body
include <studio.h>
main()
{
int a,b,c,d,f;
a=10;
b=20;
c=a<100||b>50;
printf("%d",c);
d=a<100&&b>50;
printf("%d",d);
f=a==!b;
printf("%d",f);
}

O/p:
100

# data[].attributes.body
#include<stdio.h>
int main()
{
int a=5,b=10,ret;

ret=( (a <= b) || (a != b) );
printf("Return value of above expression is %d\n",ret);

ret = ( ( a < b) && (a == b ) );
printf("Return value of above expression is %d\n",ret);

ret = ! ( ( a < b) && (a == b ) );
printf("Return value of above expression is %d\n",ret);

return 0;
}

# data[].attributes.body
include<stdio.h>
#include<conio.h>
void main()
{
int i;
printf("Enter a Number : ");
scanf("%d",&i);
if(i!=0)
{
printf("It is a non zero Number");
}
else
{
printf("It is zero");
}
getch();
}

Output :

Enter a Number : 7
It is a non zero Number

# data[].attributes.body
#include<stdio.h>
void main()
{
int a,c,b;
printf("Enter the inputs: ");
scanf("%d,%d,%d",&a&b&c);
int s= a&&b || b!c ;
printf("The result is %d",s);
}
Output:
Enter the inputs: 1,1,0
The result is 2

# data[].attributes.body
#include<studio.h>
int main()
{
int a,b;
printf("Enter the no:");
scanf("%d%d",&a,&b);
printf("%d",a&&b);
return 0;
}
O/P:
Enter the no:5
Enter the no:7
0

# data[].attributes.body
#include<studio.h>
Int main()
{int a,b;
Printf("enter numbers");
Scanf("%d %d",&a,&b);
Printf("logical operator:",a&&b);
}
Output
Enter numbers:2  4
Logical operator:0

# data[].attributes.body
#include <stdio.h>

int main() {
int x = 10;
int y = 5;

// Using logical AND operator (&&)
if (x > 5 && y < 10) {
printf("Both conditions are true\n");
}

// Using logical OR operator (||)
if (x > 15 || y > 10) {
printf("At least one condition is true\n");
}

// Using logical NOT operator (!)
if (!(x == y)) {
printf("x is not equal to y\n");
}

return 0;
}

# data[].attributes.body
#include<stdio.h>
int main()
{
int a,b;
printf("Enter two numbers:");
scanf("%d%d",&a,&b);
printf("%d",(a<b) && (a==b));
printf("%d",(a>=b) || (a<b));
printf("%d",!(a==b));
return 0;
}

Output:
Enter two numbers:
10
20

0
1
1

# data[].attributes.body
#include<stdio.h>
int main()
{
int a, b;
Printf("enter value:") ;
Scanf("%d,%d", &a, &b) ;
Printf("%d", a&&b) ;
}
Output:
Enter a value:2, 6
2-0010
6-0110
Output:2

# data[].attributes.body
#include<studio.h>
void main()
{
int a=10,b=15;
printf("%d",a||b);
}
O/P
1

# data[].attributes.body
#include<stdio.h>
int main()
{
int a,b;
Printf("enter a:");
Scanf("%d",&a);
Printf("enter b:");
Scanf("%d",&b);
Printf("%d",a>5&&b<10);
}