# Difference between operators and operands in C/C++ programming language

Learn: What are the differences between operators and operands in C, C++ and other programming languages, this tutorial will explain about the expression, operands and operators in details.

Consider the following expression

x = a+b;

In this expression x, a and y are the operands, = and + are the operands.

An expression may have following parts

- Operands
- Operators
- Special symbols (also known as operators)

### 1) Operands

In any operation, an operand may any numerical value (known as literals in programming languages), variables, constant, function calling etc on which program makes an operation.

**For example**, if we want to add two integer numbers through the expression (10+20), here 10 and 20 are being added through operator +, thus 10 and 20 are the operands. Same as if we want to add two variables through the expression (a+b), here a and b are being added through the operator +, this x and y are also the operands.

### 2) Operators

Operators are the special kinds of symbols (or function like words (sizeof)) that are used to perform any specific task like mathematical and logical.

**For example**, there is an expression to add two integer numbers (10+20), here 10 and 20 are the operands and being added through the special symbol + (plus), thus plus (+) is an operator here. Another example, there is a logical expression (age>=18), here we are going to check whether age is greater than or equal to 18 or not, thus greater than or equal to (>=) is the combination of two special symbols > and =, it is also an operator in C/C++ and other programming languages too.

### 3) Special Symbols

In any programming language, an expression may have other special symbols too, that are not used to perform any mathematical or logical operations but they are also an important part of an expression.

**For example**, there is an expression x= (a+b); here, ; (semicolon) and brackets are operators, semicolon (;) is using to terminate the expression and brackets are using to put the expression in an unit.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions