Given a stack with Integers, write a function that pops the top two numbers from the stack, adds them together and pushes the result back...
Search Results
Searching for: Integer
Individual Exercises
What is the value of y after this code has run?
int y = 2; y = 10;
Write a recursive function called add_digits
that will receive a positive number and returns the sum of each of digits. For example,...
Write a recursive function called half_left
that will receive a measurement of the amount of a chemical that is decaying. The amount will...
Write a recursive function called is_increasing
that will receive a vector of integers called list and determine whether or not it is...
Given an array containing three ints, return the sum of all the elements. It is safe to assume that the array always has at least 3...
This method accepts two integer arrays as its parameters and returns a new array, which contains all of the elements of first parameter...
Given an array of integers, return the largest value in the array. Assume the array has only posivitive numbers. If the array is empty,...
Given an array of int
s, return the smallest value in the array. Assume the array has only posivitive numbers. If the array has no values...
Given an array of integers, return the sum of all the values in the array.
Given an array of integers, return the first element in the array that is larger than maxVal
. Assume the array has only posivitive...
Given an array of integers numbers
, return the nth
element in the array that is larger than maxVal
. Assume the array has only posivitive...
Given two integers a
and b
passed as arguments to sumints
, return the sum of their values.
Given an array of int
s, return the POSITION (i.e., the index) of smallest value in the array. Assume the array has only posivitive...