|
more than 450 programs for free
|
![]() English |
![]() Slovensky |
![]() Česky |
![]() Šarišsky |
|
Category: Source in Pascal (KMP) Author: Unknown - please send me mail Program: Div_mod.pas File exe: Div_mod.exe In this program user enters 2 numbers and program finds the answer with the reminder.
Views: 1611x
{ DIV_MOD.PAS } { In this program user enters 2 numbers and program finds the } { answer with the reminder. } { } { Author: Unknown } { Datum: 20.01.2009 http://www.trsek.com } program Div_and_Mod; uses crt; var n1,n2,ans,ans2:integer; begin clrscr; writeln ('enter 2 numbers to be divided by each other'); writeln; writeln; readln (n1,n2); ans := n1 div n2; ans2 := n1 mod n2; writeln; writeln; if (ans2 = 0) then begin writeln ('The answer is ',ans); end else begin writeln ('The answer is ',ans,' remainder ',ans2); end; readkey; end. [Run] [Save] [Print] [Send e-mail] |
|