Have to produce printf statement by using below equation.
x, y, z are integers and a, b ,c are lengths, both previously defined in my code into a printf statment such that printf produces in form:
x*a + y*b +z*c = total length used
so output would look like
0*65 + 0*50 + 1*35 = 35
Printf statement?
printf("%d*%d + %d*%d + %d*%d = %d",x,a,y,b,z,c,x*a+b*y+c*z);
Reply:sum=x*a+y*b+z*c;
printf("%d * %d + %d * %d + %d * %d= %d", x,a,y,b,z,c,sum);
where sum is used to store sum of above expression
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment