Question: QUESTION 2 . This is a selectable question that contains short programming questions. You are only required to write code snippets and not complete programs.

QUESTION 2. This is a selectable question that contains short programming questions.
You are only required to write code snippets and not complete programs.
Answer the following questions by writing code snippets using the C++ programming
language:
a) Using only one std::cout statement, write the required code to produce the following
output:
"Be the change that you wish to see in the world."
Mahatma Gandhi
b) Write code that asks the user to enter his/her name, age and town in variables name of
type string, age of type int and town of type string respectively and exactly in the
mentioned order.
c) Using two for loops, output the following triangle made up of asterisks:
*******
d) Write the required code to ask the user to enter a menu option between 1 and 5. If the
menu option entered by the user is not within the range of 1 to 5 then the user should
be asked to re-enter the option. This should be repeated until a valid menu option is
entered.
e) Write the required code to output on separate lines the even numbers between 1 and n,
where n is a variable of type int.
 QUESTION 2. This is a selectable question that contains short programming

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!