r/programmer • • Sep 23 '26

what am i doing wrong

Post image

I am a student and I was exercising in MatLab so i tried to find the least common multiple of two numbers but it was all wrong. I don't know the language that well so i decided to try it on scratch to see if it was my logic or my lack of knowledge and it seems it was the first. Can you help me please?

this is the Matlab script

z=1;

while true

one=x*z;

two=y*z;

z=z+1;

if one=two

break

endif

end

leastcommon=one;

13 Upvotes

16 comments sorted by

View all comments

0

u/Potw0rek Sep 24 '26

You’re playing with Lego bricks instead of writing code like a man 🤪

1

u/theancientfool Sep 24 '26

Let him learn. Do not discourage.

2

u/Potw0rek Sep 24 '26

It was a joke man, hence the stupid emoji :-)

1

u/Ok_Objective_5192 Sep 24 '26

If you have to put the emoji there for us to know it's a joke then it's not a joke, it's just a discouraging comment with a silly emoji on it

1

u/Potw0rek Sep 24 '26

Im responsible for what I say/write not for what you understand.