19.6k views
5 votes
Which of the following is the Boolean logical operator for AND in C#?

User Sandeeps
by
6.1k points

1 Answer

7 votes
char *pch = 0; ... (pch) && (*pch = 'a');

heres an example

// expre_Logical_AND_Operator.cpp // compile with: /EHsc // Demonstrate logical AND #include <iostream> using namespace std; int main() { int a = 5, b = 10, c = 15; cout << boolalpha << "The true expression " << "a < b && b < c yields " << (a < b && b < c) << endl << "The false expression " << "a > b && b < c yields " << (a > b && b < c) << endl;
User Peter Bratton
by
5.5k points