Made the same program in C