Exercise -3 Solution(C-Programming):