

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between & and &&
In this post, we will understand the difference between the ‘&’ and ‘&&’ operators.
& operator
It is a bitwise operator.
It evaluates the left and right side of the expression.
It operates on the ‘Boolean’ datatype (True or False).
It also operates on bits.
It is used to check the logical conditions.
It can also be used to mask off specific bits (like the parity bits).
Example
#include<stdio.h> int main(){ int x = 3; int y = 4; int z = x & y; printf ("z = %d", z); return 0; }
&& operator
It is a logical operator.
It evaluates the left side of the expression only.
It operates on ‘Boolean’ datatype only.
It is used to check the logical conditions.
Example
#include<stdio.h> int main(){ int a = 6, b = 3; printf("%d", a&&b); return 0; }
- Related Questions & Answers
- Differences between & and && operators in Java.
- Difference between the AND and && operator in php
- The difference between 'AND' and '&&' in MySQL?
- Difference between selenium IDE, RC & WebDriver.
- Difference between process.cwd & _ _dirname in NodeJS
- Comparison between "&&" and "AND" operator in PHP.
- What is Logical AND Operator (&&) in JavaScript?
- Difference Between Interface and Abstract Class in Java & C#
- ‘AND’ vs ‘&&’ operators in PHP
- What is the difference between JavaScript, JScript & ECMAScript?
- Difference between Slip Ring & Squirrel Cage Induction Motor
- What is double address operator(&&) in C++?
- What is difference between int and const int& in C/C++?
- What's the difference between nohup and ampersand (&) on Linux?
- PHP Why does this && not trigger as false?
Advertisements