According to my Pascal's homework I finds difficult to program the next question:
Write a program that will find and print the first dual-digits number that fulfilling the next term:
The sum of the two digits must be 7 AND and tens's digit must at least bigger then 3 from the unity.
I tried solving this question, here's my following attemp:
Program Dual_number;
var
i,tens,unity:integer;
begin {main}
for i:=10 to 99 do
begin {loop}
tens:=i mod 10;
unity:=i div 10;
if (tens+unity=7) and (ten-unity>3) then
writeln(i);
end; {loop}
end. {main}
Question
zachacham
hey all,
According to my Pascal's homework I finds difficult to program the next question:
Write a program that will find and print the first dual-digits number that fulfilling the next term:
The sum of the two digits must be 7 AND and tens's digit must at least bigger then 3 from the unity.
I tried solving this question, here's my following attemp:
Thanks in advanced!
Link to comment
https://www.neowin.net/forum/topic/253694-help-in-pascal-writing-program-with-loop/Share on other sites
7 answers to this question
Recommended Posts