Not sure what language you're using, but here's the basic idea:
dim myCount as integer = 1
dim N as integer = 10000000000 '10,000,000,000
For i as integer = 2 to N
If N mod i = 0 Then
myCount += 1
End If
Next i
Notes:
- Mod gives you the remainder of division. So for example:
- 10 mod 1 = 0 (because 1 goes into 10 10-times exactly)
- 10 mod 2 = 0 (...
- 10 mod 3 = 1 (because 3 goes into 10 3-times, with a remainder of 1)
- 10 mod 4 = 2 (because 4 goes into 10 2-times, with a remainter of 2)
You only want to count the results where N mod i = 0, because those are the only instances where i goes into N with no remainder; which I think is what your teacher probably means when they say 'divisor' -- no remainder.
The variable declarations (dim...) and the For loop might be written slightly differently in whatever language you're using. The code above is VB. But if you look in your book index, you'll probably find your language's version of these two common features.
EDIT
OK -- in that case, just add another FOR loop, as follows:
dim myCount as integer = 1
dim N as integer = 10000000000 '10,000,000,000
For i as integer = 1 to N
For j as integer = 2 to i
If i mod j = 0 Then
myCount += 1
End If
Next j
Next i