Write a function called foo_moo that takes a number as an argument and returns the following statements according the below mention conditions. Then, inally prints the statement in the function call. If the number is divisible by 2, it should return "Foo". If the number is divisible by 3, it should return "Moo". If the number is divisible by both 2 and 3, it should return "FooMoo". • Otherwise, it returns "Boo". Example1: Function Call: 0o_moo(5) Output: Boo

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.3: Returning Multiple Value
Problem 7E
icon
Related questions
Question
Task 3
Write a function called foo moo that takes a number as an argument and returns the following statements according the below mention conditions. Then,
finally prints the statement in the function call.
• If the number is divisible by 2, it should return "Foo".
• If the number is divisible by 3, it should return "Moo".
• If the number is divisible by both 2 and 3, it should return "FooMoo".
• Otherwise, it returns "Boo".
=========
%=============
Example1:
Function CalI:
foo_moo(5)
Output:
Воо
Transcribed Image Text:Task 3 Write a function called foo moo that takes a number as an argument and returns the following statements according the below mention conditions. Then, finally prints the statement in the function call. • If the number is divisible by 2, it should return "Foo". • If the number is divisible by 3, it should return "Moo". • If the number is divisible by both 2 and 3, it should return "FooMoo". • Otherwise, it returns "Boo". ========= %============= Example1: Function CalI: foo_moo(5) Output: Воо
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning