Convert prompts1.c to C++