C Program To Show The Use Logical Operator.

Q7. Write a C program to show the use logical operator.

Solution:

#include<stdio.h> //standard input/output header file

#include<conio.h> //for clrcsr()

int main()

{

int a,b,c,d;

 

clrscr(); //clears the screen

 

a=10;

b=20;

c=5;

 

//Logical Operators are used to combine multiple conditions

d=a>b&&b==c;

 

printf(“\n d=%d”,d);

 

getch(); //holds the screen until any key is pressed

return 0; //makes the main() finish

}

 

OUTPUT:

d=0;

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: