This preview shows page 1. Sign up to view the full content.
Unformatted text preview: count_spaces( str ): set k to 0 set spaces to 0 while str[k] != \0 do if str[k] == then set spaces to spaces + 1 set k to k + 1 return spaces end main: set s to one two three set count to count_spaces(s) print count //This should print 2 end...
View
Full
Document
This note was uploaded on 08/29/2011 for the course CIS 209 taught by Professor Aren during the Spring '11 term at Kansas State University.
 Spring '11
 aren

Click to edit the document details