#include <iostream> #include <string> using namespace std; const string PHRASE = "Hello World"; int main () { string greeting; greeting = PHRASE + ", how are you?"; cout << greeting << endl; return 0; }
#include <iostream> using namespace std;const string PHRASE ="Hello World";int main(){string greeting;greeting=PHRASE+ ",how are you?";cout <<greeting<<endl;return 0;}
char middleInitial; int age; float income; bool married;
char firstInitial, middleInitial, lastInitial; int day, year; float grossPay, netPay, deductions, taxRate;
cout << 5; LHS operator RHS
cout << 5; cout << endl;
cout << 5 << endl;
char x;
char aLetterForYou;
cout << aLetterForYou <<
char a, aLetter; a = 'q'; aLetter = a; cout << aLetter << endl;
string firstName; firstName = "Dan"; cout << firstName << endl;
string fullName; fullName = "Dan Bennett";
string firstName; string lastName; string fullName; firstName = "Dan"; lastName = "Bennett"; fullName = firstName + lastName; cout << fullName << endl;
// Variables to hold the user's name string firstName, // The first name middleName, // Middle Name of the person lastName; // The last name of the user /********************************************************** * We will now print the user's name * **********************************************************/