How to resolve the algorithm Arithmetic/Integer step by step in the МК-61/52 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Arithmetic/Integer step by step in the МК-61/52 programming language

Table of Contents

Problem Statement

Get two integers from the user,   and then (for those two integers), display their:

Don't include error handling. For quotient, indicate how it rounds   (e.g. towards zero, towards negative infinity, etc.). For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.

Bonus: Include an example of the integer divmod operator. For example: as in #Haskell, #Python and #ALGOL 68

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Arithmetic/Integer step by step in the МК-61/52 programming language

Source code in the мк-61/52 programming language

П1	<->	П0
+	С/П
ИП0	ИП1	-	С/П
ИП0	ИП1	*	С/П
ИП0	ИП1	/	[x]	С/П
ИП0	^	ИП1	/	[x]	ИП1	*	-	С/П
ИП1	ИП0	x^y	С/П


  

You may also check:How to resolve the algorithm CSV data manipulation step by step in the Go programming language
You may also check:How to resolve the algorithm Loops/For with a specified step step by step in the Fortran programming language
You may also check:How to resolve the algorithm Mandelbrot set step by step in the PowerShell programming language
You may also check:How to resolve the algorithm Visualize a tree step by step in the Kotlin programming language
You may also check:How to resolve the algorithm Create a file on magnetic tape step by step in the Ruby programming language