153k views
2 votes
Assume that name and age have been declared suitably for storing names (like "abdullah", "alexandra" and "zoe") and ages respectively. write some code that reads in a name and an age and then prints the message "the age of name is age." where name and age are replaced by the values read in for the variables name and age. for example, if your code read in "rohit" and 70 then it would print out "the age of rohit is 70", on a line by itself. there should not be a period in the output

1 Answer

3 votes

Answer:

Step-by-step explanation:

It is assumed that name and age have been declared suitably for storing names and ages. so the following is the code to read in a name and age and printout the message "the age of name is age. "

cin >> Name;

cin >> Age;

cout << "The age of " << Name << " is " << Age << ".";

User Suriv
by
4.7k points