C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 6, Problem 6.35RE
Program Plan Intro

Program Plan-

  • Include the header files and initialize the main() function.
  • Prompt the user to take the input of integer array.
  • To define the recursive function printArray (int [], int) that takes integer array as input and its size to print the array.
  • Call the function to display the output.
  • Define the function role in the respective function definition.

Summary Introduction- The program prints the array using recursive function.

Program Description- The purpose of the program is to take the integer array as input and print it using the following recursive function and returns nothing.

voidprintArray (int [], int)

Blurred answer
Students have asked these similar questions
(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 inclusive using initializeArray (from question 1) and counts the occurrence of each number in the array and graphs the information in the form of a bar chart or histogram—each number is printed, then a bar consisting of that many asterisks is printed beside the number. Here is a sample run of the program: Number               Value                    Histogram  1…
(Recursive Greatest Common Divisor) The greatest common divisor of integers x and y isthe largest integer that evenly divides both x and y. Write a recursive function gcd that returns thegreatest common divisor of x and y. The gcd of x and y is defined recursively as follows: If y is equalto 0, then gcd(x, y) is x; otherwise gcd(x, y) is gcd(y, x % y), where % is the remainder operator.
(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 using initializeArray (from question 1) and counts the occurrence of each number in the array and prints the occurrences. Note: Print time or times correctly. Hint: Declare another array called count that stores the number of each value as you count the numbers of the original array. Use printArray (from question 1) to print the values of count. Here is a sample run of the program: 1…

Chapter 6 Solutions

C How to Program (8th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning