Hello guys and girls.

Any idea how to find containing numbers of one specific number. For example number 10:

10 = 9+1
10 = 8+2
10 = 7+3

I tried to do something like ‘random(10)’ but got nowhere with that.

Cheers to all,
marygreen

Recommended Answers

All 3 Replies


10 = 9+1
10 = 8+2
10 = 7+3

Where do you want to search?Where do you store them,in string?

Hi FalmingClaw.

Need to generate them and print them in a memo.

Never mind. I did it this way:

begin
C.value:=10;
while num1.value<c.value do
begin
num1.value:=num1.value+1;
num2.value:=c.value-num1.value;
memo1.lines.add((floattostr(num1.value))+'__'+(floattostr(num2.value)));
end;
if (num1.value=c.Value) then
begin
showmessage('Done');
end;
end;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.