I was wondering if anyone can help, because i cn get it to work in java but not in C++.

#include <iostream.h>

void main()
{
int input;
cout<<"Type in a number\n";
cin>>input;
for (int i = 1; i <= input; i++)
{
input = i * input;
}
cout<<input
}

like i said, i got it to work injava, but whenever i type something in here i get something totally different (like -1899959296 for 5 when it should be 120).