We study K-theory of the pullback $C^*$-algebras and the pushout $C^*$-algebras such as amalgams of $C^*$-algebras and balanced tensor products of $C^*$-algebras, and obtain that their K-groups are isomorphic under the reasonable assumptions on their $\ast$-homomorphisms.