Download presentation
Presentation is loading. Please wait.
Published byEdgar McLaughlin Modified over 8 years ago
1
Review
2
Problem 1 What is the output of the following piece of code void increment(int x) { x++; } int main() { int y = 10; increment(y); cout << y <<endl; return 0; }
3
Problem 2 Write a function that checks whether an integer divides at least one element of a finite sequence of integers. The sequence has less than 500 elements. If the division succeeded, the index of the element must be computed. Write a function that checks whether an integer divides all elements of a finite sequence of integers. As above, the sequence has less than 500 elements.
4
Problem 3 Repeat the previous problem with the assumption that the maximum number of elements is not known at compile time. Write a program that computes the remainder of elements of a finite sequence of integers and a given integer.
5
Problem 4 Write a program that takes a finite sequence of real number and two real numbers r and h, and computes the number of elements inside the range, the number of elements less than r, and the number of elements greater than h. The maximum number of elements in the sequence is 100. Write the program above but dropping the last condition.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.