Let A be a simple C*-algebra with real rank zero, stable rank one and weakly unperforated K0(A) of countable rank. We show that a monomorphism Φ: C(S2) → A can be approximated pointwise by homomorphisms from C(S2) into A with finite dimensional range if and only if certain index vanishes. In particular,we show that every homomorphism ϕ from C(S2) into a UHF-algebra can be approximated pointwise by homomorphisms from C(S2) into the UHF-algebra with finite dimensional range.As an application, we show that if A is a simple C*-algebra of real rank zero and is an inductive limit of matrices over C(S2) then A is an AF-algebra. Similar results for tori are also obtained. Classification of Hom (C(X), A) for lower dimensional spaces is also studied.