C language programming to achieve a free curve