Algorithm : Counts | ||||||||||||||||||||||||||
A variable (integer) is used to count values which satisfy a certain condition. Remember counting always starts from 0 so the value of the variable must be initialised to 0. Example 20 marks are to be input. How many of them are over 50? We will use a variable
called 'counter' to store the number of marks over
50.
|
||||||||||||||||||||||||||