algorithm for finding prime no in c language