x -=y;
Chat with our AI personalities
X**y
double round (double x) return (int) x + 0.5;
double square (double x) { return x*x; } double cube (double x) { return x*x*x; }
' Return the maximum of a,b,c Function max(ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Integer Dim maxAB As Integer maxAB = Math.Max(a, b) Return Math.Max(maxAB, c) End Function
In practice, it is better to use the Math class, which already has a pow() (i.e., power) function. If you want to program it yourself, just write a loop:double myPower(double x, int y){double result = 1;for (int i = 1; i