Question: Get a copy of the is_even.cpp file by: --------------------------- // // Program to test is_even function. // #include using namespace std; void is_even(int); // Function

Get a copy of the is_even.cpp file by:

---------------------------

// // Program to test "is_even" function. // #include  using namespace std; void is_even(int); // Function Prototype int main( ) { int num; cout << "Enter an integer: "; cin >> num; cout << "Is " << num << " even? "; is_even(num); cout << endl; return 0; } // "is_even" function. // Prints "yes" if a is even, "no" otherwise. void is_even(int a) { // insert code here to complete the function // use if else structure } 

----------------------------

Entering the cp command: cp /net/data/ftp/pub/class/110/ftp/cpp/is_even.cpp is_even.cpp

or, using your mouse to copy and paste the program into Pico, or

using the Hercules command-line ftp program to copy this file from the CS Department's anonymous ftp site.

 The path: pub/class/110/ftp/cpp The file: is_even.cpp 

The purpose of this program is to practice using user defined functions.

Add code to the program to complete it.

Compile and run this C++ program.

The program output should look like the following:

hercules[66]% CC is_even.cpp -o is_even hercules[67]% is_even Enter an integer: 12 Is 12 even? yes hercules[69]% is_even Enter an integer: 23 Is 23 even? no hercules[70]% is_even Enter an integer: -17 Is -17 even? no hercules[71]% is_even Enter an integer: 466 Is 466 even? yes hercules[72]% 

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!