Titus Jr I.

asked • 11/15/20

Declaring and Initializing C++ Variables

  1. Declare an integer variable named myNewAge.
  2. Declare and initialize an integer variable named myCurrentAge. Initialize this variable with your current age.
  3. Declare and initialize an integer variable named currentYear. Initialize this variable with the value of the current year. Use four digits for the year.
  4. Execute the program by clicking the Run button at the bottom of the screen.

Sample program execution:

My Current Age is 29.
I will be 65 in 2050.


1 Expert Answer

By:

Patrick B. answered • 11/15/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.