Logical Operator && || in C Programming - learnit

Home Top Ad

Post Top Ad

Saturday, May 8, 2021

Logical Operator && || in C Programming

Logical Operator &&|| in C Programming

Logical Operator &&|| in C Programming

C Porogramming

C programming is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.


Why to Learn C Programming ?

C programming language is necessary for students and working professionals to become a great Software Engineer especially when they are working in Software Development Domain. I will list down some of the key advantages of learning C Programming


-C++ is used to develop games, desktop apps, operating systems, browsers, and so on because of its performance.


-After learning C++, it will be much easier to learn other programming languages like Java, Python, etc.


-C++ helps you to understand the internal architecture of a computer, how computer stores and retrieves information.


-Easy to learn

-Structured language

-It produces efficient programs

-It can handle low-level activities

-It can be compiled on a variety of computer platforms


Logical AND (&&) operator in C

Logical AND is denoted by double ampersand characters (&&), it is used to check the combinations of more than one conditions; it is a binary operator – which requires two operands.


Operator Description Example
|| Called Logical OR Operator. If any of the two operands is non-zero, then the condition becomes true. (A || B) is true.
&& Called Logical AND operator. If both the operands are non-zero, then the condition becomes true. (A && B) is false.
! Called Logical NOT Operator. It is used to reverse the logical state of its operand. If a condition is true, then Logical NOT operator will make it false. !(A && B) is true.

#include<stdio.h>
#include<conio.h>
int main()
{
int a=10,b=20,c=40,d=20;
if(a<b || c>d)
{
printf("Hello Knowledge Education Cambodia");
}
}
Output

Hello Knowledge Education Cambodia



Please Watching My Video is Below

No comments:

Post a Comment

Post Top Ad