Hey guys, i been looking through at questions regarding roman numerals and i have a question. i ran some of the coding which i found and i dont quite understand this part..
int number = 3000;
int number2 , i ;
number2 = number / 1000;
for(i = 1; i <= number2; i++)
cout << 'M';
When i run this, the expected result will be MMM. but when i changed , int number = 3001 , i still get back the result of MMM. Why is this? I would have expected the program not to give any solution at all?
Am i right to say that in c++ , when you use division ( /) , it will keep dividing till the point it is unable to divide any smaller?
Hope you guys can help explain this to me.