0
form an array with elements Akn = nFi + 11 (k) + sin (k) Fi + 12 (n), where u = 3, k, n = 1,2,3,4. Display it as a matrix.
calculate the product of the values of the elements for which the inequality Akn <-1 holds Does my code calculate correctly? #include <iostream> #include <conio.h> #include <math.h> using namespace std; int main() { const int k = 4, n = 4; float a[k][n]; long int mult = 1; for (int k = 0; k < 4; k++) { for (int n = 0; n < 4; n++) { a[k][n] = n * 14 * k + sin(k) * 15 * n; //cout << a[k][n] << " "; cout << k << "\t" << a[k][n] << "\n"; } cout << endl; } if (a[k][n] < -1) mult *= a[k][n]; cout << a[k][n] << " "; cout << "\n" << mult << "\n"; system("pause"); return 0; }
3 Respuestas
+ 6
What's your question about the code? Where are you stuck?
+ 1
If this is a challenge to other users, please post it in activity feed instead.
Else if this is a task you need to do, please try it yourself first and show us what you did.
https://www.sololearn.com/discuss/1316935/?ref=app
0
did it count everything correctly?