Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The function 1s_odd () takes 1 parameters type of double returns a 1 if the number is odd and if the number is even. The

image text in transcribed
The function 1s_odd () takes 1 parameters type of double returns a 1 if the number is odd and if the number is even. The function print_is_odd () prints out "Number is ODD" if the input parameter is 1, and "Number is EVEN" if the input parameter is 0. However, the code produces the wrong output when executed as shown in the figure below. Rewrite the single line of code that will fix this bug. mainc 1 #include 2 3 int is odd (int n); 4 void print_is_odd(int flag); 5. int main() 6 7 int number = 89; 8 print_is_odd(is_odd(number)); 9 10 return; 11 } 12 13. int is_odd(int n){ 14 - if (n/2 == 0){ 15 return 1; 16 - } else { 17 return 0; 18 } 19} 20 21. void print_is_odd(int flag){ 22 - if(flag == 1){ printf("Number is ODD"); 24 - } else { 25 printf("Number is EVEN"); 26 } 27 } 23 input Number is EVEN ... Program finished with exit code o Press ENTER to exit console

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

=+7 How has the COVID-19 pandemic impacted the operations of IHRM?

Answered: 1 week ago