this small math question was a homework when I took c programming class in college.