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 (9th Edition)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Absolute Java (6th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
- Answer in C programming languagearrow_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_forwardز١arrow_forward
- C 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_forwardi just need the code please java C++arrow_forward
- hello, c++ programming homework deals with array make menu that has option 1 2 and 3 to get back to the menu that has option 1 2 and 3 is to repeat , and then press d to exit the menu.arrow_forwardMinutes(using Pointers) by Catherine Arellano Write a program that will accept an integer value from 0000 to 2359. It will then extract the first 2 values of the integer to be the hours, and the last 2 to be the minutes. Implement the following functions: void extracts(int* time, int* hour, int* min); /* extract the hours and minutes from the time and stores the result to the address of hour and min respectively.*/ void display (int* hour, int* min); /*display the hours and minutes*/ Note: You are not allowed to edit main.c and Time.h. Input A time in format HHMM 1430 Output Hours and minutes Hour: 14 Minutes: 30 main.c Time.h 1 #include 2 #include "Time.h" 3 int main(void) { M456909 7 8 } int time, hour, min; scanf("%d",&time); extracts (time, &hour, &min); display (&hour, &min); return 0;arrow_forwardSee code in attached image.Please explain what this code is doing / what is happening.arrow_forward
- Q2: Write a C++ function (call it index_max) that finds the maximum number in the array, that is passed to the function, and returns the max number and its index. For example, if you pass [5,6,8,9,5,2] to the function, you obtain 9 and 3. Write a C++ program and test your function. Take the following notes into consideration when writing your program: 1- Your function should work with any data type. 2- The function should prevent changing the elements of the passed array. 3- You are not allowed to use materials that are not covered in our lectures.arrow_forwardUse C++ codingarrow_forwardWrite and test the “digit” function: Function Prototype: int digit(int n,int k)This function returns the kth digit of the positive integer n. For example, if n is the integer 29,415 that is entered by user , then the call digit(n,0) would return the digit 2, and the call digit(n,2) would returnthe digit 4. do this only by using functions and loops. arrays are not allowed. example :Input: n = 29415 , k = 1 output: 9 Input: n = 2 , k = 1 output: index out of bound (return -1)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