Course Code : TEB1024
Lecturer : Saipunidzam Mahamad Date Assigned : Week 08 Due Date : Week 09
________________________________________________________________________
Exercise In a group of two choose ONE (1) question in Part A and ONE (1) question in Part B.
Part A
Write a Little Man program that accepts three values as input and produces the largest of the three as output. (CS)
Write a Little Man program that accepts three values as input and outputs them in order of size, largest to smallest (IT)
Part B
Write a Little Man program that prints out the odd numbers from 1 to 99. No input is required.
Write a Little Man program that prints out the sums of the odd values from 1 to 39. The output will consist of 1, 1+3, 1+3+5, 1+3+5+7 … No input required. As an aside, do you notice anything interesting about the output results that are produced by this series? This series is sometimes used as a part of an algorithm for finding square roots of numbers.
____________________________________________________________________________________________________________
Share with your friends: |