Answer to Question #276940 in Algorithms for takdol

Question #276940

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.



















1
Expert's answer
2021-12-07T15:04:53-0500
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS