What is the output of the following
// Function prototypes
void fillArray(char [ ] , int)
void showArray(const char[], int)
int main ()
{ char prodCode[8] = { '0', '0' 0 '0'' '0' '0' '0' '0' '0'
}
fillArray(prodCode,8);
showArray(prodCode,8);
return 0;
// Definition of function fillArray
// (Hint : 65 is the ASCII code for 'A'.}
void fillArray(char arr[], int size}
{ char code= 65;
for ( int k = O; k < size; code++, k++ )
arr[k] = code;
}
// Definition of function showArray
void showArray(const char codes[ ] , int size)
{ for (int k = O; k < size; k++)
cout << codes[k ] ;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out with C++: Early Objects
Additional Engineering Textbook Solutions
Mechanics of Materials (10th Edition)
Modern Database Management
Starting Out With Visual Basic (8th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Python (4th Edition)
- Using “Def” keyword write a function that returns the Max element of the given array elements (The function name will be MaxofArrayElements) Not: Write some print functions to see the outputs inside each function. (Python programming language) (Solution must be like first image but max of arrays.it shouldnt be like second image)arrow_forwardC++ Coding: ArraysTrue and False Code function definitions for eoNum() and output(): Both eoNum() and output() are recursive functions. output() stores the even/odd value in an array. Store 0 if the element in the data array is even and store 1 if the element in the data array is odd. eoNum() displays all the values in an array to the console.arrow_forwardWrite a function that takes as argument an array of integers and the size of the array and returns the average of the input values. Int = avrg(int * array, int size) write the code in c++ pleasearrow_forward
- ز١arrow_forwardC PROGRAMMING - write a function get_output which takes a two dimensional array as parameter and returns the number of ones found in both the diagonals of the array. (assume the array is filled with 0's and 1's only)arrow_forwardii) What will be the maximum element of the array given below if the first k elements are removed from the array. Input the value of k from the user. int A[] = {34, 67, 1, 89, 156, -12, 78, 100, 23}; Programming languages: C/C++arrow_forward
- i just need the code please java C++arrow_forwardYou are given an array of integers and you have to swap the first and last element of the array without using a third variable. Modify the original array and do not create a new array. Time: O(1) Space: O(1) Language: C You need not write the complete code, complete the function, void modify(int *arr, int n){ }arrow_forwardc++ program Generate 10 random values between 1 and 1000 using built-in function “rand()” and store the values in an array. Pass the array of 10 random values to a function “MinMaxFunction” that can find the minimum and maximum value in the array and return the minimum and maximum values in the array to the main function. The values are then printed in the main function. (Note: rand()%1000 will generate random values from 0 till 999).arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education