Why are we doing a C exercise inside a cpp file?

I am confused here: we are doing this exercise in exercise2.cpp and not exercise2.c. (There are more exercises who use the cpp file, but i just took this as an example) I thought we were learning c and not cpp.