answersLogoWhite

0


Best Answer

The boolean and operator in C and C++ is &&

a < 3 && b > 4 // relational

The bitwise and operator in C and C++ is &

maskresult = maskinput & maskvalue // bitwise

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

if you mean and in the condition statements the and operator is "&&"

but if you mean that AND in logic design like "0101+0001=0001" the operator is "&"

you can use the link: http://msdn.microsoft.com/en-us/library/z0zec0b2%28VS.71%29.aspx

// expre_Bitwise_AND_Operator.cpp

// compile with: /EHsc

// Demonstrate bitwise AND

#include <iostream>

using namespace std;

int main() {

unsigned short a = 0xFFFF; // pattern 1111 ...

unsigned short b = 0xAAAA; // pattern 1010 ...

cout << hex << ( a & b ) << endl; // prints "aaaa", pattern 1010 ...

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

All the logical operators in C++ are:

== (equals to)

!= (not equals to)

< (smaller than)

> (bigger than)

<= (smaller than or equals to)

>= (bigger than or equals to)

&& (and)

(or)

The logical operators is used to test if something is true. Example:

if(1 > 3)

{

cout << "Hello";

}

That will only happen if 1 is less that 3. Wich will always be true so it will execute no matter what.

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

There is no operator ' in C++. It is merely a token or symbol used to delimit literal characters:

char c = 'a';

The ' token is also known as a single quote, as opposed to " which is the double quote token which is used to delimit strings of characters:

char str[] = "Hello world";

To store a literal single quote in a character type, you must use the escape sequence \':

char c = '\''; quote, slash, quote, quote

However, single quotes can be used in strings without an escape sequence:

char str[] = "An ampersand ('&') literally means 'and'";

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a logical operator in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the operator that cannot be overloaded in c plus plus and java?

conditional operator , size of operator , membership operator and scope resulation operator can not be overload in c++


What is the operator is used to allocate the memory in c plus plus?

calloc operator,malloc operator


What is the operator of power in c plus plus?

There is no "power" operator in C or C++. You need to the use the math library function pow().


Example of binaray operator in c plus plus?

+ is an example, one of many, of a binary operator in C or C++ a = b + c; // for usage example


What is the memory management operator in c plus plus?

There is no memory management operator in C++ -- it is an unmanaged language. You use the C++ new operator to allocate memory, and use the C++ delete operator to release previously allocated memory.


Why are there 2 plus sign in c plus plus and Why not a single plus sign?

In C and in C++, the ++ operator means to increment. C++ was intended to be the next version, i.e. the incremental next step, of C, hence the use of the ++ operator.


What do the two plus stand for in C plus plus?

The ++ in C++ refers to the postfix increment operator (operator++()). It's literal meaning is "the successor to C", in reference to the C language upon which the C++ language is based.


Can the scope resolution operator be overloaded in C plus plus?

No.


What is the difference between Conditional and Logical operator in C?

entirely different thingsconditional operator: ? : logical operators:AND: && OR: NOT: !also you can count XOR: != eg:if ((a==3) != (b==c)) printf ("XOR: Exactly one of the two conditions is true\n");


What is the meaning of and in C programming language and when is it used?

logical and: exp1 &amp;&amp; exp2 means: exp1==0 ? 0 : exp2==0 ? 0 : 1


How unary minus can be overload in c plus plus?

type operator- ();


Which operator is used for deallocating memory in c plus plus?

delete