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
prompt x floor(x + .5) -> x disp x
x - (y + 2)
dim x as integerdim y as integerdim z as integeron error goto Errorhandleruser input "Type first integer"x = user inputuser input "Type second integer"y = user inputuser input "Type third integer"z = user inputif z = 2+x and if y = 1+x thenprint "These numbers are consecutive!"print "Their product is" x*y*zelseif z 2+x or if y 1+x thenprint "These numbers are not consecutive."endifgoto quitErrorhandler: Print error codequitThis is about as stripped down a program as you can write. Depending on the scripting language, you will have to re-write the syntax to comply with that language's rules for syntax and commands.
++x; x++; x += 1; x = x + 1;
The person or program that solves the equation does.
X**y
what is a program x and y
x + 1 would be a consecutive integer where x is an integer.
Short answer: Yes. Long answer: it depends on the order. If x is negative and y is positive, then x-y<0; y-x>0 (this second one is only correct if |y|<>|x|). And if |y|=|x| then y-x=0 (this is the one you're looking for, where x and y are equal, but y is positive and x is negative). Finally, if you know if |y|=|x| or |y|<>|x| then y-x>=0
double round (double x) return (int) x + 0.5;
Write a simple program in finding roots x^3-6x^2+11x-6.1=0
Only if x is already an integer. For any integer x, 2x + 2 will be an even integer.