72.4k views
1 vote
Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia") Write some code that reads a value into name then prints the message "Greetings, NAME" where NAME is replaced the value that was read into name. For example, if your code read in "Rachel" it would print out "Greetings, Rachel"

User JClaspill
by
4.7k points

1 Answer

4 votes

Answer:

void main(){

string name;

cout<<"Enter Name";

cin>>name;

cout<<"Greetings " ;

cout<<name;

}

Step-by-step explanation:

in main function we declared a variable called "name" .using cin we are reading the value into name and we are printing that name using cout.

User Cody Hess
by
4.9k points