Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ You are to write a program that takes an integer input from the user. If the value is a number greater than zero,

image text in transcribed

In C++

You are to write a program that takes an integer input from the user. If the value is a number greater than zero, you will report to the user whether the number is odd or even. Here are the possibilities. Assume the variable num contains the value inputed from the user 1. If num is positive and odd print The number is odd. There should be no other program output 2. if num is positive and even print "The number is even." There should be no other program output. 3. If num is 0 (zero) print "The number is 0. There should be no other program output. 4. If num is negative print "The number is negative." There should be no other program output You will need to use a combination of if if/else statements to complete this exercise. Here are some helpful hints. The C+ code "return 0:" can be used multiple times within maino. Whenever that code is run the program ends. So for example, if you have input a value from cin into a variable num, the following code will check to see if num is 0, print out the appropriate message, and terminate the program: if (num-e) cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions