1 / 4
Nov 2018

Where is bug? (C++)

#include <iostream>

using namespace std;
int main()
{
	int howMuch, x;
	long double result;
	cin >> howMuch;
	for (int i = 0; i < howMuch; i++)
	{
		cin >> x;
		result = 1;
		for (int j = 1; j <= x; j++)
		{
			result *= j;
		}
		cout << result << endl;
	}

    return 0;
}
  • created

    Nov '18
  • last reply

    Jun '19
  • 3

    replies

  • 827

    views

  • 3

    users

7 months later

Meh

  1. I wasn’t cross.
  2. It’s a reasonable question. Answering it would guide the OP to the fault.
  3. Dying is compulsory, we will all do it.