• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions! Dokkio, a new product from the PBworks team, integrates and organizes your Drive, Dropbox, Box, Slack and Gmail files. Sign up for free.


Exercise 14_1 Solution

Page history last edited by Steve Sweeney 11 years ago

var num1, num2 : int

var quotient, remainder : int

var answer : real


% ask the user for two positive integers

put "Please enter two positive integers: " ..

get num1, num2


% perform integer division and output results

quotient := num1 div num2

remainder := num1 mod num2

put "Integer Division: "..

put num1, "/", num2, " = ", quotient, " remainder ", remainder


% perform real division and output the results

answer := num1/num2

put "Real Number Division: "..

put num1, "/", num2, " = ", answer

Comments (0)

You don't have permission to comment on this page.