C Programming Tutorial - Order of Arithmetic Operation


Hey guys,

in this tutorial I am going to explain the order of arithmetic operation in c programming language. The order of arithmetic operation in c programming language is same as order of arithmetic operation in real life. Lets look at that through example.

Input

#include <stdio.h>

int main() {

int a = 4 +2 *6;
printf ("Result: %d \n", a);


b = (4+2)*6;
printf("Result: %d \n", b;

}

Output

Result: 16                                                                                                                       
Result: 36

Comments