Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

taking apart 1001001101

Status
Not open for further replies.

Ineedhelp37

Programmer
Mar 1, 2006
2
US
Taking a part 1001001101
I need to write a program that can output information for every one and zero but I’m not sure what function to use,

The output would look like
Yes 1 times
No 2 times
Yes 1 times
No 2 times
Yea 2 times
No 1 times
Yes 1 times

How would I go about doing this?
 
It strongly depends on how are you receiving the data ... is that a Turing machine?

Cheers,
Dian
 
If the value is the same, increment your count
If the value is different, print the count and reset it.


--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top