Explain logical operators, C/C++ Programming

Assignment Help:

Logical Operators

We say any expression that evaluates to zero is a FALSE logic condition and that evaluating to non-zero value is a TRUE condition. Logical operators are useful in combining one or more conditions. The following are the logical operators :

                &&         AND

                ||           OR

                !              NOT

The first two operators are binary, while the exclamation(!) is a unary operator. It is used to negate the condition.

e.g.

                x<0 && y>10      evaluates to true if both conditions are

true

                x < 0 || z = = 0   evaluates to true, if one of the

conditions is true

                !(x == 0)                                               evaluates to true if condition is false.

The unary negation operator (!) has a higher precedence amongst the these, followed by the and (&&) operator and then the or(||) operator, and are evaluated from left to right.

 


Related Discussions:- Explain logical operators

Oop, evolutio of object oriented programing

evolutio of object oriented programing

Padovan.., count the number of string in n-th padovan string

count the number of string in n-th padovan string

C program to copy the contents of a file, C Program to copy the contents of...

C Program to copy the contents of a file: void main()    {   ifstream fin("input.txt");   ofstream fout("output.txt");   char ch;   while (fin)       {

Define functions with arguments and return values, Define Functions with ar...

Define Functions with arguments and return values? The earlier category functions receive values from the calling function through arguments but do not send back any value rath

Rules of inheritance, Rules of Inheritance: Private members are not...

Rules of Inheritance: Private members are not inherited; the members can be accessed only within its class. It cannot be used through the object. Protected members are

Modified distribution method for solving transportation prob, i want a c or...

i want a c or c++ code for solving transportation problem using modified distribution method

Destructor on a local variable, Should I explicitly call a destructor on a ...

Should I explicitly call a destructor on a local variable? Explain it.

Operator overloading, write aprogram in c++ to overload +,-,=,++ operator ...

write aprogram in c++ to overload +,-,=,++ operator using unary and friend function in a single program

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd