if (number % 2 == 0) if (number % 2 == 0) cout << number << " is even"; else if (number % 5 cout << number << is even"; cout << number << if (number % 5 == 0) cout << number << = 0) is multiple of 5"; is multiple of 5"; (a) (b)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 13RQ
icon
Related questions
Question

What is the output of the following code if number is 14, 15, and 30?

if (number % 2 == 0)
if (number % 2 == 0)
cout << number << " is even";
else if (number % 5
cout << number <<
is even";
cout << number <<
if (number % 5 == 0)
cout << number <<
= 0)
is multiple of 5";
is multiple of 5";
(a)
(b)
Transcribed Image Text:if (number % 2 == 0) if (number % 2 == 0) cout << number << " is even"; else if (number % 5 cout << number << is even"; cout << number << if (number % 5 == 0) cout << number << = 0) is multiple of 5"; is multiple of 5"; (a) (b)
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Print statement
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT