For starters in this expression statement
cin >> john, jeff, philip, joe, dave;
there is used the comma operator. It is equivalent to
( cin >> john ), ( jeff ), ( philip ), ( joe ), ( dave );
So all the operands after the first operand
( jeff ), ( philip ), ( joe ), ( dave )
do not produce any effect.
It seems you mean
cin >> john >> jeff >> philip >> joe >> dave;
Again in the condition of this if statement
if (john, jeff, philip, joe, dave)
there is used an expression with the same comma operator. The value of the expression is the value of last operand dave
contextually converted to the type bool.
It is unclear what you are trying to check in this if statement.
Nevertheless the following pair of statements should be enclosed in a compound statement like
if (john, jeff, philip, joe, dave)
{
cout << "you have been cursed, you will have bad luck" << endl;
cout << "for the rest of your life!" << endl;
}
else
{
cout << "you have been blessed, enjoy your life" << endl;
cout << "and keep praying to God" << endl;
}
It seems you mean something like the following
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
string name;
cout << "Hello and welcome to the blessing service" << endl;
cout << "please enter your name and god will" << endl;
cout << "decide if you are cursed or blessed" << endl;
cout << "______________________________________" << endl;
cin >> name;
if (name == "john" || name == "jeff" || name == "philip" || name == "joe" || name == "dave")
{
cout << "you have been cursed, you will have bad luck" << endl;
cout << "for the rest of your life!" << endl;
}
else
{
cout << "you have been blessed, enjoy your life" << endl;
cout << "and keep praying to God" << endl;
}
system ("pause");
return 0;
}
The condition in the if statement can be changed as you like.