Hey there, Do you know? What is an operator in c? If not, then let me explain you the concept of an operator in c with operator priority and associativity
What is an operator?
Declaration gives the list of variables with a different type of values to be used, the operator is something which tells what to be done to the declared variables.
Every operator in c has
Why 6/5 gives 1 not 1.2 in C program?
Do you know, if we calculate 6/5 gives 1 not 1.2 in C
Similarly, 4/8 gives 1 not 0.5
Do you know why? Because both values are integers then C evaluate result also int not float but when one value is int and another value is float then it evaluates result also as float, so 6.5/5.5 gives 1.1818 which is obvious.
Still confused! Have you ever checked the arthimatic in c, if not, then check now
Arithmetic in c result
normal Arithmetic result
Observe the results carefully you will notice, arithmetic in C is different than the normal arithmetic because when both values are integers then C evaluate result as int not float
So, when ever you do any arithmetic operation in C some problems may crop up.