I believe the following code may have been written erroneously. The comment states ‘Adding 0.001 for a thousand times’. But the code is actually ‘Adding 0.1 for ten times’ which returns 1. Great course on D by the way! Cheers!
// Adding 0.001 for a thousand times:
int counter = 1;
while (counter <= 10) {
result += 0.1;
++counter;
}
Type your question above this line.
Course: https://www.educative.io/collection/10370001/5443442018615296
Lesson: https://www.educative.io/collection/page/10370001/5443442018615296/6324827021377536