• 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. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.


Exercise 14_1 Solution

Page history last edited by Steve Sweeney 11 years, 6 months 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.