Article View: comp.lang
Article #7Re: I can't figure out how to write this program
From: Scott A. Moore
Date: Thu, 23 Nov 1995 00:00
Date: Thu, 23 Nov 1995 00:00
36 lines
2047 bytes
2047 bytes
In article <48t8ub$hld@lemon.easynet.co.uk>, robandrews@easynet.co.uk
says...
>
>Please give help to a Pascal beginner.
>
>I'm using TPW 1.5 and I need to write a program that checks whether a
>given number is exactly divisible by three or not.
>I will need to input a number and get a report back on if it is or
>isn't.
>I can't figure out how I am going to get the program to test this.
>
>A program will not be essential from you, but I would like to know the
>algorithm for the calculation. E-mail would be preferred.
>
>Thanks,
>Robert Andrews
>robandrews@easynet.co.uk
>
program div3(input, output);
var n: integer;
begin
write('Please input the number: ');
readln(n);
writeln;
if (n mod 3) = 0 then writeln('Number is divisible by 3')
else writeln('Number is not divisible by 3)
end.
Note that this is program works for ANY known pascal.
[sam]
Technical Details
Message-ID:
<491bno$79@vnetnews.value.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<48t8ub$hld@lemon.easynet.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10261c,bb2b906775402ad5 X-Google-Attributes: gid10261c,public X-Google-Thread: 111659,bb2b906775402ad5 X-Google-Attributes: gid111659,public X-Google-Thread: 15878d,bb2b906775402ad5 X-Google-Attributes: gid15878d,public X-Google-Thread: 1153ea,bb2b906775402ad5 X-Google-Attributes: gid1153ea,public X-Google-Thread: 102601,bb2b906775402ad5 X-Google-Attributes: gid102601,public X-Google-Thread: 10263e,bb2b906775402ad5 X-Google-Attributes: gid10263e,public X-Google-Thread: f461d,bb2b906775402ad5 X-Google-Attributes: gidf461d,public From: sam@ccnet.com (Scott A. Moore) Subject: Re: I can't figure out how to write this program Date: 1995/11/23 Message-ID: <491bno$79@vnetnews.value.net> X-Deja-AN: 120006112 references: <48t8ub$hld@lemon.easynet.co.uk> organization: Value Net Internetwork Services Inc. mime-version: 1.0 newsgroups: comp.lang,pascal,comp.lang.pascal.borland,comp.lang.pascal.misc,ctdl.lang.pascal,maus.lang.tpascal,relcom.comp.lang.pascal,relacom.comp.lang.pascal.misc,slac.lang.pascal