#include <iostream>
#include <iomanip>
#include "cstdlib"
usingnamespace std;
int main()
{
double num, x, y;
cout << "Enter a whole number to determine the product of all odd numbers below: " << endl;
cin >> num;
x = 1;
y = 1;
while (x <= num)
{
y = x * y;
x = x + 2;
}
cout << setiosflags (ios :: fixed) << endl;
cout << " The product of all the odd numbers up to " << num << " IN DECIMAL FORM is: " << y << endl;
cout << setiosflags (ios :: scientific);
cout << endl;
cout << "The product of all odd numbers under " << num << " in SCIENTIFIC NOTATION is: " << y << endl;
system ("Pause");
return 0;
}
Your opening statement says "product of all odd numbers below: {number}"
But then one of your output prints says "all the odd numbers up to {number}"
So which is it?
If it's below, then you'd have the following test cases