Why used #include <string>?

Why do we use #include in the given problem, there is no use of that library on that place?

By using this you can use string data type in you code. Include actually have several operations. So include is a directive and after that you can several functions related to string such as String.size() and etc

#include <stdioo.h> is a header file.

is a sub or pre processor .the preprocessor to include the contents of a specified file at the point where the directive appears like library,string …etc that can be included in a header file