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 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 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 hisher 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 and If the
menu option entered by the user is not within the range of to then the user should
be asked to reenter 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 and n
where is a variable of type int.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
