Study guides

☆

Q: Write a program to subtract integer y from integer x?

Write your answer...

Submit

Still have questions?

Related questions

prompt x floor(x + .5) -> x disp x

public class Test { public static void main(String[] args){ int x = 10; System.out.println("Square value = " + (x * x)); } }

x - (y + 2)

Public Sub Main() Dim X As Integer Dim Y As Integer Dim cnt As Integer 'Our counter. cnt = 1 Do Debug.Print X X = Y + X Y = X - Y If cnt >= 8 Then Exit Do Else cnt = cnt + 1 End If Loop End Su

Let x = 1, let y = 0.Print x.Let x = y + xLet y = x - yRepeat from 2.Public Sub Main() Dim X As Integer Dim Y As Integer Dim cnt As Integer 'Our counter. cnt = 1 Do While cnt < 8 Debug.Print X X = Y + X Y = X - Y cnt = cnt + 1 Loop End Sub

++x; x++; x += 1; x = x + 1;

X**y

The person or program that solves the equation does.

what is a program x and y

x + 1 would be a consecutive integer where x is an integer.

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.

Only if x is already an integer. For any integer x, 2x + 2 will be an even integer.

People also asked