0
What is the problem does not print correct results
#include <iostream> using namespace std; int main() { double x = 2, y = 1, z = 3, i = 0, j = 0, l = 0, fact = 1, fac = 1, fa = 1, n, p; double eq = 0.0, sum = 0; cout << "Enter n : "; cin >> n; for (p = 0; p < n; p++) { for (i = 1; i <= x; i++) { fact *= i; } for (j = 1; j <= y; j++) { fac *= j; } for (l = 1; l <= z; l++) { fa *= l; } eq += ((fact + fac) / fa); x += 2; y += 2; z += 3; } cout << eq; return 0; }
3 Respuestas
+ 3
tell us what you are making. your code excutes perfectly expect you didn't used the variable sum anywhere in your code after declaring it
0
Coding Kitty I want to calculate the numbers multiplied and then collect and divide as indicated in the matter But I didn't get the right answers.