Skip to main content

Posts

Showing posts with the label Expressions and Operators.

Expressions and Operators in C++.

An Expression is composed one more or more operand and operations to be applied on them.  In C++ Operand can by anything like an integer, a float, or a array and the operations applied to the operands are represented by Operators .  We can classify the Operators in three Categories - Unary Operators. Binary Operators. Ternary Operator. ( will be discussed at last ) (Don't try to relate anything about Binary Operators and Binary Numbers.) 1. Unary Operators - Unary operators are those which act on only one operand.(Do you know any operators like this? YES, you have seen them previously), The address of (ampersand (&)) operators and de-reference (*) operator. These two operators are Unary operators, We have used them like -  #include<iostream> using namespace std; int main () { int a = 10 ; // Initialization of variable 'a' int *b = &a; // Storing address using unary operators '*' and '&' in b return 0 ; } You c