here it is I am currently learning C by reading "Beginning C" by Ivor Horton and there is an example that is not explained as detailed as I would hope:
#include <stdio.h>
void main()
{
int number = 0;
int rebmun = 0;
int temp = 0;
printf("\nEnter a positive integer: ");
scanf("%d", &number);
temp = number;
do
{
rebmun = 10 * rebmun + temp % 10;
temp = temp/10;
} while(temp);
printf("\nThe number %d reversed is %d rebmun ehT\n", number, rebmun);
}
that which is bolded is what I have a question on, why does C claculate the modulus before multiplying. I have a chart that explains it but it has only:
* / % From left to right
now from what I learned back in Algebra that meant that they were all equal and would be performed in order they appeared except that the modulus operator is located after the multiplication. Some one please explain the logic behind this.
Sean