Write a program that creates two substrings from the main string.
The main string is made up of first and last names and is equal to "John Doe." The first substring is the first name.
The second substring is the last name.
Print the main string and two substrings afterward.
You can use the following code structure.
#include <iostream> int main() { //your code here }
#include <iostream> #include <iostream> int main() { std::string fullname = "John Doe"; std::string firstname = fullname.substr(0, 4); std::string lastname = fullname.substr(5, 3); std::cout << "The full name is: " << fullname << '\n'; std::cout << "The first name is: " << firstname << '\n'; std::cout << "The last name is: " << lastname << '\n'; }