Write a c++ program that will prompt a user to input one word answers to the following questions.
What is your name? What state do you live in? What year did you start college?
Once the user has entered the answer to each question, output as follows:
Hello,
My name is name. I am from state. I enrolled in college in year.
Solution
#include <iostream>
using namespace std;
int main()
{
int year;
char name[20],state[20];
cout<<\"What is your name? : \";
cin>>name;
cout<<\"What state do you live in?: \";
cin>>state;
cout<<\"What year did you start college? : \";
cin>>year;
cout<<\"\ Hello,\";
cout<<\"\ My name is \"<<name<<\".\";
cout<<\"I am from \"<<state<<\".\";
cout<<\"\ I enrolled in college in \"<<year<<\".\";
}
.