Arithmetic statements
In C language we found Arithmetic Operator, that provide us the ability to perform some mathematical operations on our data. It opens up the door of mathematic for programmers.
The statements that take two operand and one arithmetic operator called Arithmetic statement.
Arithmetic operators name with their sign are :
►Addition +
►Substraction -
►Multiplication *
►Division /
►Modulas or Reminder Operator %
We can also use Arithmatic operators with Assignment operator. These operators are use with Assignment operator, which is the sign of equal operator = .
We use equal operator with arithmetic operators , that makes up compund assignment statement.
Where a and b are operands(values) and between them are Compund Assignment operators.
► a += b
► a -= b
► a *= b
► a /= b
► a %= b
We can write these compact opertors into open form that take space and time of us.
► a = a + b
► a = a - b
► a = a * b
► a = a/ b
► a = a% b
Both of methods are same at their funcationality but one of them take time and effort and one is flexible.Its totally up to you which method is suitable for you.
Practical Example:
Write a program that perform all arithmetic operators on data.
❤____________________________________________________❤
If you guys want more videos on problems and syntax of langauges, Just let me know in comments and or you guys can DM on my Instagram:
► Abubakar Hafeez
Feel free to contactš„°
❤____________________________________________________❤
0 Comments