![]() |
VOOZH | about |
As already known character range is between -128 to 127 or 0 to 255. This point has to be kept in mind while doing character arithmetic.
Character arithmetic is used to implement arithmetic operations like addition, subtraction, multiplication, and division on characters in C language.
In character arithmetic character converts into an integer value to perform the task. For this ASCII value is used.
It is used to perform actions on the strings.
To understand better let's take an example.
-121 y
So %d specifier causes an integer value to be printed and %c specifier causes a character value to printed. But care has to taken that while using %c specifier the integer value should not exceed 127.
Let's take one more example.
numerical value=100 numerical value=97 numerical value=124
a = A
b = B
a + b = â