Write an algorithm that declares two integers and initializes them to 199 and 76. Display the sum, difference, product, average, square, and remainder of the values.
Start
Declare variable number1
Declare variable number2
Declare variable sum
Declare variable difference
Declare variable product
Declare variable average
Declare variable remainder
Declare variable squareNumber1
Declare variable squareNumber2
Set number1 = 199
Set number2 = 76
Set sum= number1 + number2
Set difference=number1 - number2
Set product=number1 * number2
Set average=(number1 + number2)/2
Set remainder=number1 mod number2
Set squareNumber1=number1 * number1
Set squareNumber2=number2 * number2
Display sum
Display difference
Display product
Display average
Display squareNumber1
Display squareNumber2
Display remainder
Stop
Comments
Leave a comment