What is the output of the following
#include <iostream>
using namespace std;
// Function prototypes
void fil1Array(char [], int);
void showArray(const char [], int);
int main ()
{
const int SIZE = 8;
char prodCode[SIZE] = {‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’,};
fillArray(prodCode, SIZE);
showArray(prodCode, SIZE);
return 0;
}
// Definition of function fill Array.
// (Hint: 65 is the ASCII code for ‘A’)
void fillArray(char arr[], int size)
{
char code = 65;
for (int k = 0; k < size; code++, k++)
arr[k] = code;
}
// Definition of function showArray.
void showArray(const char codes[], int size)
{
for (int k = 0; k < size; k++)
cout ≪ codes[k];
cout ≪ endl;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Additional Engineering Textbook Solutions
Modern Database Management (12th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Database Concepts (8th Edition)
Programming in C
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- Fill in the c code for the question below: Define the function: void deleteAtV1(int num[], int *count , int pos); //The function deletes the item at pos For example: Test Result int num[10]={4,5,1,2,8}; int coun=5; deleteAtV1(num,&count,2); display(num,count); 4528 code: void display(int num[], int size){ int i; for(i=0;i<size; i++) printf("%d", num[i]);} // Fill up this missing code to delete [2} in the arrayarrow_forwardprogram Credit Card Validator - Takes in a credit card number from a common credit card vendor (Visa, MasterCard, American Express, Discover) and validates it to make sure that it is a valid number (look into how credit cards use a checksum) - it's a C++ program so use #include <iostream> - And please use an array, use files, and use pointers in this program. -arrow_forwardC++arrow_forward
- code and output screenshot is mustarrow_forwardLab Assignment Question 3-Program in C++ to take input size of array from user and then take input valeues of array and print the sum of values at even index in the array only.arrow_forwardDo code in c++.Dont use string and built in Functions .Use only #include<iostream> header file . Use 2d array.arrow_forward
- Example: Write a C++ program that calculates the sum and average of an initialized integer array. #include using namespace std;arrow_forwardvi) In C++, rotate the array given below to left by 2 places and print it in the output. int A[6] = {12, 34, 56, 78, 2, 21}; Expected Output: {56, 78, 2, 21, 12, 34}arrow_forwardC Programming Write function updateHorizontal to flip the discs of the opposing player, it should do the following a. Return type void b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. Structure Player (i.e. player) as a pointer c. If the square to the left or right is a space, stop checking d. If the square to the left or right is the same character as the player’s character, stop checking e. If the square to the left or right is not the same character as the player’s character, flip the disc (i.e. X becomes O, O becomes X) Write function updateVertical to flip the discs of the opposing player, it should do the following a. Return type void b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. Structure Player (i.e. player) as a pointer c. If the square above or below is a space, stop checking d. If the square above or below is the same character as the player’s character, stop checking e. If the square above or below is not the same character as…arrow_forward
- Please assist as far as you can. Not a big deal if programme does not run, help with the codes as far as possible.3arrow_forwardWrite a function recursively_count_vowels() which accepts a pointer to a string, and any other parameters you see fit, and recursively counts the number of vowels in the provided string. This function should return the number of vowels in the string. (programming language c)arrow_forwardCode in C++ please.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