There are no assigned lab exercises for this week. You should instead spend the time preparing for the prac exam and/or working on Assignment 1.
You might like to try implementing the Bonus Challenge from last week, or the programs discussed in this week or last week's tutorial. Here are a few examples of the style of questions that might appear on the first Prac Exam:
1 3 5 7
***** **** *** ** *
power_of_two(int k)
which takes an ineger k
and returns 1 if k
is a power of 2, and returns 0 otherwise.
average(int n, int a[])
which takes an integer n together with an array a[] of n integers,
and prints the average of the n items in this array, to two decimal places.
EOF
is reached, then prints the number of times that
each of the digits '0' to '9' has occurred in the input.
1232527232B2D232D2J2your program should print
0 0 1 1 2 10 3 3 4 0 5 1 6 0 7 1 8 0 9 0