Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a CH program to implement a function named Avg, the function receives 2-D array of integer, the number of rows, and the number of
Write a CH program to implement a function named Avg, the function receives 2-D array of integer, the number of rows, and the number of columns. This function returns the average of the diagonal elements in the 2D array- double Avg (int a[][3], const int r, const int c); 5 3 8 Example: The function will print: 4 (5+4+3)3 6 4 4 7 1 3 In your main do the following: Create 2-D array of integer of size (3x 3) and initialize it as in the figure above Call Avg Function and print the average to the screen
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started