Basic algebra formulas that you can revise anytime and anywhere

FORMULAS FOR BEGINNER (a+b) ^2= a^2+b^2+2ab (a+b) ^2= (a-b) ^2+4ab (a-b) ^2= a^2+b^2-2ab (a-b) ^2= (a+b) ^2-4ab a^2+b^2= (a+b) ^2-2ab a^2+b^2= (a-b) ^2+ 2ab a^2-b^2= (a+b) (a-b) (a+b+c) ^2= a^2+b^2+c^2+2(ab+bc+ac) (a-b-c) ^2= a^2+b^2+c^2-2(ab-bc+ac) (a+b) ^3= a^3+b^3+3ab(a+b) (a-b) ^3= a^3-b^3+3ab(a-b) a^3+b^3= (a+b) (a^2-ab+b^2) a^3-b^3= (a-b) (a^2+ab+b^2) a^4-b^4= (a^2-b^2) (a^2+b^2) = (a^2+b^2) (a+b) (a-b) a^5+b^5= (a+b) (a^4-a^3b+a^2b^2-ab^3+b^4) a^5-b^5= (a-b) (a^4+a^3b+a^2b^2+ab^3+b^4)

Operators in C programming




  •  Operators


An operator is a symbol. Compiler identifies Operator and performs specific mathematical or logical operation. C provides following operators :
# Arithmetic Operators
# Increment and Decrement Operators
# Relational Operators
# Logical Operators
# Cast Operators
# Bitwise Operators
# Assignment Operators


  • Arithmetic Operators


* multiplication
/ division
% remainder after division (modulo arithmetic)
+ addition
- subtraction and unary minus


  •  Increment and Decrement Operators


Increment and decrement operators are used to add or subtract 1 from the current value of oprand.

++ increment
-- decrement

Increment and Decrement operators can be prefix or postfix. In the prefix style the value of oprand is changed before the result of expression and in the postfix style the variable is modified after result.

For eg.
a = 9;
b = a++ + 5; /* a=10 b=14 */
a = 3;
b = ++a + 6; /* a=10 b=15 */


  •  Relational Operators


== equal.
!= Not equal.
> < Greater than/less than
>= greater than or equal to
<= less than or equal to


  •  Logical Operators


&& Called Logical AND operator. If both the operands are non-zero, then condition becomes true.

|| Called Logical OR Operator. If any of the two operands is non-zero, then condition becomes true.

! Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true, then Logical NOT operator will make false.


  •  Cast Operators


Cast operators are used to convert a value from one to another type.
(float) sum;   converts type to float
(int) fred;   converts type to int


  •  Bitwise Operators 


Bitwise operators performs operation on actual bits present in each byte of a variable. Each byte contain 8 bits, each bit can store the value 0 or 1

~ one's complement
& bitwise AND
^ bitwise XOR
| bitwise OR
<< left shift (binary multiply by 2)
>> right shift (binary divide by 2)


  •  Assignment Operators


= assign
+= assign with add
-= assign with subtract
*= assign with multiply
/= assign with divide
%= assign with remainder
>>= assign with right shift
<<= assign with left shift
&= assign with bitwise AND
^= assign with bitwise XOR
|= assign with bitwise OR

For example,
a = a + 64; is same as
a += 64;



Comments

Popular posts from this blog

How to answer " What are your goals?"(HR QUESTION)

Basic algebra formulas that you can revise anytime and anywhere