You have two main errors in your program.
1). Use insert symbols before inserting anything in cout statement.
cout << "Nice !! "<<subject<< " is a good subject";
2); If your subject name includes a space in between then don't use cin statement to get the value from the user. because you are storing a string. Use this getline statement to get the value.
getline(cin,subject);
Use this corrected code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string subject;
cout << "What is your favourite subject ==> ";
getline(cin, subject);
cout << "Nice !! "<<subject<< " is a good subject";
return 0;
}
OUTPUT:
What is your favourite subject ==> Physical Education
Nice !! Physical Education is a good subject
I hope this will help you.