SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
Arrays
Exercise:
Self-test Exercises
Question:15 | ISBN:9780321531346 | Edition: 7

Question

Insert const before any of the following array parameters that can be

changed to constant array parameters:

void output(double a[], int size);

//Precondition: a[0] through a[size - 1] have values.

//Postcondition: a[0] through a[size - 1] have been

//written out.

void drop_odd(int a[], int size);

//Precondition: a[0] through a[size - 1] have values.

//Postcondition: All odd numbers in a[0] through

//a[size - 1] have been changed to 0.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

Correct code:

void output( const   double a[], int size);

void drop_odd(int a[], int size);

 

0 0

Discussions

Post the discussion to improve the above solution.