Reputation: 11
I input this into java and these errors come out. error ")" expected, error not a statement , and error ";" expected. but i do not understand why?
pent = n(3n-1)/2;
Upvotes: 0
Views: 82
Reputation: 44854
In java this would be
double pent = n * (3.0 * n - 1.0) / 2.0;
Upvotes: 1