CODE:
#include <iostream>
using namespace std;
// function
void findEvenOrOdd(int num){
// check if even or not
if(num%2==0)
cout<<num<<" is an EVEN number"<<endl;
else
cout<<num<<" is an ODD number"<<endl;
}
// main method
int main() {
findEvenOrOdd(6);
findEvenOrOdd(11);
}

OUTPUT:

Please upvote if you like my answer and comment below if you have any queries or need any further explanation.
This exercise is also from C++ How do I even figure this out? please help me...
python programming
X Canvas 4 → XCO Question 26 10 pts (SHORT ANSWER) Define a function named find_even_odd that has 1 parameter: num. When the function is called, it should use an if/else statement to determine whether the variable num is an even or odd number and display appropriate message as follows: • If the value in num is an even number, the progr will output the message: "XX is an EVEN number", where XX is the value in the...
In this exercise, you will create a script called if_then_else.sh that uses an IF THEN ELSE statement. The if_then_else.sh script will Use one command line argument, which will be a number between 1 and 10 Assign the value of the first argument to a local variable called NUM. HINT: Look at line 5 in the example screenshot for arguments.sh Use one IF THEN ELSE statement to compare the value of NUM If the number is less than 5, display the...
this is written in c++
This code needs to work with any input to have the output with
different numbers that are entered in.
Please help me I need help with this problem.
Thanks
$ Section 4.4 is a part of assignment Lab21: Number Divisible by 4 and/or 5 Requirements: zylab Entire class due: 03/01/2020, 11:59 PM 4.4 Lab 21: Number Divisible by 4 and/or 5 Write a program that reads in an integer number. It should then determine if...
C++ Functions can return a string, not just an int or a float. Write a function called everOrOdd which takes an integer parameter and returns either "Even" or "Odd" based on the value passed. In main, prompt the user for a number, called num, then pass num to evenOrOdd and display the returned value on the screen. Keep doing this until the user enters a zero. Use the following run as an example: Enter a number: 11 Odd Enter a...
This is used as C++
How do I even figure this out at all? Please help me solve
this tough question
Question 30 10 pts (SHORT ANSWER) Write three separate if blocks to check the following THREE conditions (number your answers): 1. If the number variable testScore is outside the range of 0 through 100 (excluding both those scores), print the message: "INVALID: OUTSIDE RANGE 0-100" 2. If the number variable bonusPoints is inside the range 1 through 10 (including...
c++ please
(1) Write a program that prompts the user to enter an integer value N which will rpresent the parameter to be sent to a function. Use the format below. Then write a function named CubicRoot The function will receive the parameter N and return'its cubic value. In the main program print the message: (30 Points) Enter an integer N: [. ..1 The cubic root of I.. ] is 2 update the code om part and write another function...
C++ Give me an example of how you could use an if statement. The example should include a summary (Algorithm) of the program, and how you would use the if statement. I am including an example aswell. For example, suppose you had a program to determine if a number is positive, negative or zero. Read in a number and then use the if statement to determine if the number is positive (>0) or negative (<0) or zero (==0): if (x>0)...
I
need help with this exercise. Thank you for your help
Language is C++
6. Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number. (Note: An even number is prime if it is 2. An odd inte- ger is prime if it is not divisible by any odd integer less than or equal to the square root of the number.)
I want to know how to do this assignment!!! Help me please~ The first part of your program should do the following: • Ask the user type of test they took. o (ACT or SAT) • If they said ACT then ask them their score o If their ACT score was between 0 and 7 say "Needs Work" o If their ACT score was between 10 and 20 say "Acceptable" o If they ACT score was above 20 say "Above...
This is a matlab HW that I need the code for, if someone could
help me figure this out it would be appreciated.
The value of t can be estimated from the following equation: in your script file, estimate the value of π for any number of terms. You must ask the user for the desired number of terms and calculate the absolute error/difference between your calculation and the built-in MATLAB value ofpi. Display your results with the following message...