BODMAS expressions Program in C


/*P4.12 Program to evaluate some expressions*/
int main(void)
{
	int a,b,c,d,e,f,g,h,k;
	a=8, b=4, c=2, d=1, e=5, f=20;
	printf("%d\t", a+b-(c+d)*3%e+f/9);

	a=17, b=5, c=6, d=3, e=5;
	printf("%d\t",a%6-b/2+(c*d-5)/e);

	a=4, b=5, c=6, d=3, e=5, f=10;
	printf("%d\t",a*b-c/d


Output:

10      5       0       1       1
c language tutorial learn c language study c language