#include int main(){ // arithmetic operators // + (addition) // - (subtraction) // * (multiplication) // / (division) // % (modulus) // ++ increment // -- decrement int x = 5; int y = 2; // int z = x + y; // int z = x - y; // int z = x * y; // float z = x / (float) y; // int z = x % y; // x++; // y--; printf("%d", x); printf("%d", y); return 0; }
hi thanks for your sessions and your effort i have problem to understand why these two code with two different results? #include int main() { int i = 1; printf("%d %d %d ", ++i,i++, i); return 0; } the result will be 3 1 3 ----------------------------------------------------------------------------------------------------- but if i write it like that #include int main() { int i = 1; printf("%d ", ++i); printf("%d ", i++); printf("%d ", i); return 0; } the result will be 2 2 3