Write the complete function that receives a two-dimensional array of type float and divides each element in the array by two. The array has 3 rows and 4 columns. Define your function in the same way as the given function prototype. #include #include void divide2Darray(float array[][4]); int main() { float two_d_array[3][4] = {{2.2, 2.4, 2.8, 8.0}, {2.2, 2.4, 2.8, 4.0}, {2.2, 2.4, 2.8, 4.0}}; divide2Darray(two_d_array); printf("%0.2f %0.2f %0.2f %0.2f", two_d_array[0][0], two_d_array[0][1], two_d_array[0][2], two_d_array[0][3]); return 0; }
Write the complete function that receives a two-dimensional array of type float and divides each element in the array by two. The array has 3 rows and 4 columns. Define your function in the same way as the given function prototype. #include #include void divide2Darray(float array[][4]); int main() { float two_d_array[3][4] = {{2.2, 2.4, 2.8, 8.0}, {2.2, 2.4, 2.8, 4.0}, {2.2, 2.4, 2.8, 4.0}}; divide2Darray(two_d_array); printf("%0.2f %0.2f %0.2f %0.2f", two_d_array[0][0], two_d_array[0][1], two_d_array[0][2], two_d_array[0][3]); return 0; }
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 3PE
Related questions
Question
C code Blocks
Write the complete function that receives a two-dimensional array of type float and divides each element in the array by two. The array has 3 rows and 4 columns.
Define your function in the same way as the given function prototype.
#include <stdio.h>
#include <stdlib.h>
void divide2Darray(float array[][4]);
int main()
{
float two_d_array[3][4] = {{2.2, 2.4, 2.8, 8.0},
{2.2, 2.4, 2.8, 4.0},
{2.2, 2.4, 2.8, 4.0}};
divide2Darray(two_d_array);
printf("%0.2f %0.2f %0.2f %0.2f", two_d_array[0][0], two_d_array[0][1],
two_d_array[0][2], two_d_array[0][3]);
return 0;
}
//Your answer starts here.
For example:
Test | Result |
---|---|
float two_d_array[3][4] = {{2.2, 2.4, 2.8, 8.0}, {2.2, 2.4, 2.8, 4.0}, {2.2, 2.4, 2.8, 4.0}}; divide2Darray(two_d_array); printf("%0.2f %0.2f %0.2f %0.2f", two_d_array[0][0], two_d_array[0][1], two_d_array[0][2], two_d_array[0][3]); | 1.10 1.20 1.40 4.00 |
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning