• 0

[Help in Pascal] writing program with loop


Question

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:

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}

Thanks in advanced!

7 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.