I'am trying to make program for lowest common denominator end when i enter 2 numbers it crashes.. What is wrong in this code? I'am beginner and its 20. Trenning from www.mendo.mk
Just switch the the modulus operands around and start looping at 1, because 0 % any number is always 0. for(int br3; br3 <= br1*br2; br3++)
to for(int br3 = 1; br3 <= br1*br2; br3++)
@MiiNiPaa @ThePopivanov
I'm pretty sure you can't find the lowest common multiple of 0 and any number anyway.
You could always implement an if statement to check if one of the numbers is 0, print a message and end the program.