Home > Back-end >  Calculating the average of two Numbers
Calculating the average of two Numbers

Time:12-22

#include
Int main ()
{int a, b;
Float c;
Printf (" please input two integers: ");
The scanf (" % d % d ", & amp; A, & amp; B);
C=(a + b)/2 (float).
Printf (" the mean of the two integers is % 1 f ", c);
}

CodePudding user response:

So what is your problem?

CodePudding user response:

Give you add code, return zero

CodePudding user response:

C=(a + b)/2.0 (float).//(a + b)/2 is plastic, after calculating again turn float has no meaning, so use 2.0 after converted to floating point calculations,
  • Related