Create a function which counts how many lone 1s appear in a given number. Lone means the number doesn't appear twice or more in a row. Examples count LoneOnes (101) → 2 countLoneOnes (1191) 1 count LoneOnes (1111) → 0 countLoneOnes (462)

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter3: Working With Large Worksheets, Charting, And What-if Analysis
Section: Chapter Questions
Problem 2.2EYK
icon
Related questions
Question
Create a function which counts how many lone 1s appear in a given
number. Lone means the number doesn't appear twice or more in a
row.
Examples
countLoneOnes (101) → 2
countLoneOnes (1191) → 1
countLoneOnes (1111) → 0
count LoneOnes (462) 0
Transcribed Image Text:Create a function which counts how many lone 1s appear in a given number. Lone means the number doesn't appear twice or more in a row. Examples countLoneOnes (101) → 2 countLoneOnes (1191) → 1 countLoneOnes (1111) → 0 count LoneOnes (462) 0
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
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
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
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