Convert the following program (Figure 1) to C++ program. The sample output of the program is illustrated in Figure 2. Us
Posted: Wed Apr 27, 2022 3:09 pm
Convert the following program (Figure 1) to C++ program. The sample output of the program is illustrated in Figure 2. Use VECTOR instead of array in your CH codes. 1 #include <stdio.h> 2 int main() 3D 4 float temperature (4)[3]; 5 printf ("Enter data:\n"); 6 for (int row = 0; row<4; row++) 7 B for (int col 0; col<3; col++) 9 10 printf ("Temperature [d) [td] = " row, col); 11 scanf("%f", stemperature (row] (coll): 12 1 13 1 14 15 printf("\n The inserted temperatures are as follows: \n"); 16 for (int row = 0; row<4 : row++) 17 18 for (int col = 0; col<3; col++) 19 1 20 printf ("[d] [&d] = 4.2f\t", row, col, temperature (row][coll): 21 } 22 printf("\n"); 23 24 25 return 0; 26 Figure 1 - NNNNNN The displayed temperature data is: [OJTOJ - 22.30 [0][1] = 30.10 [OJ [21 = 28.70 117 (0] = 21.20 [1][1] = 29.90 (11 (2) = 27.30 (2) [0] = 22.00 [2) (1) = 28.60 12) [2] = 29.30 Figure 2 [0][3] = 19.27 [1][3] = 25.44 [2] [3] = 22.22