i have a program that i made in my class in Turbo C++ on windows 95or98 i belive. it is made to solve for factorials. th problem is that :
A) it puts it in exponents
B) theres too many numbers to count so i need a way to put commas every 3 digits and i dont know how to do that.
C) any factorials over 1754 give the computer an error that says:
Floating point: overflow
here is my program:
how can i fix these problems?
A) it puts it in exponents
B) theres too many numbers to count so i need a way to put commas every 3 digits and i dont know how to do that.
C) any factorials over 1754 give the computer an error that says:
Floating point: overflow
here is my program:
Code:
#include<iostream.h> #include<iomanip.h> #include<conio.h> void main () { long double bfn=0; long int m=0; char pause; cout<<setiosflags(ios::fixed|ios::showpoint|ios::right)<<setprecision(0); cout<<"type what you want a factorial of"<<endl; cin>>bfn; m=bfn-1; while (m>0) { bfn=bfn*m; m=m-1; cout<<bfn<<endl; } cout<<bfn<<endl<<endl; }
Comment