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

C program for sorting of character , #include stdio.h> #include conio.h>...

#include stdio.h> #include conio.h> #include string.h>   void main() {           char a[50],b[25][25],l[25],temp1;           int i=0,j=0,k=0,l1[25],c=0,c1=0,t=

Define a procedure called make-avl-tree, This question deals with AVL trees...

This question deals with AVL trees. The representation to be used is similar to the bank account object discussed in class. (a) Define a procedure called make-avl-tree which mak

Pointer to function, how many values we can return from pointer to function...

how many values we can return from pointer to function?

Explain operators in c language, Explain Operators in C Language? The C...

Explain Operators in C Language? The C language is very rich in built - in - operators and it places more significance on operators than do most other computer languages. The C

Palindrome, A palindrome is a string that reads the same from both the ends...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

C program, program for lexicographically precedes the given input permutati...

program for lexicographically precedes the given input permutation

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers

Described storage qualifiers in c++ ?, A: They are following: Const: poi...

A: They are following: Const: point out that memory once initialized, must not be modify through a program. Volatile: denote that value in the memory location can be modified

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