Count Ones
From Progzoo
Count Ones
You want to count the number of ones in a string. In this example there are 3 "1"s in the string "011001"
[Font]
[Default]
[Show]
[Resize]
[History]
[Profile]
Count Ones - Using a method
You want to Create a method to count ones in any string.
The methdos countOnes takes a string and returns an int.
[Font]
[Default]
[Show]
[Resize]
[History]
[Profile]