Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
Expert Solution & Answer
Book Icon
Chapter 12, Problem 1E

Explanation of Solution

Purpose of given code 12.1.:

  • The code “Program 12.1.” is to check given value is even or not. It has a function named “isEven()” which get an argument and checks the value of the argument is even using “if…else” condition.
  • If the given argument value is even, the macro value of “YES” stored into the variable “answer” otherwise it assigned macro value of “NO” to the variable “answer”.
  • The main program calls the function with argument as “17” and “20”.

Expert Solution & Answer
Check Mark
Sample Output

no yes

Comparison:

The type in code prints the above output which is “equal” to the output presented in the text book.  The function returns “no” for the input value “17” and returns “yes” for the input value “20”.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Explain in your own words: a.) Why do we need file in programming? b.) What is a potential error that can occur when a file is opened for reading?
In this post, we will be discussing file extensions as well as the programs that are responsible for their creation. The provision of examples is absolutely necessary.
Write a short notes on the following appending to a file deleting a file
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr