13. Write a program that reads in an integer that is greater than 1,000 and less
ID: 3639041 • Letter: 1
Question
13. Write a program that reads in an integer that is greater than 1,000 and
less than 1,000,000. Recall that the number must be entered without a
comma. Display the number with a comma inserted where it belongs.
(Hint: use the % operator.)
( Without use of if statement)
12. For any integer n > 0, n! is defined as the product n x n - 1 x n - 2
... x 2 x 1. O! is defined to be 1. It is sometimes useful to have =-
closed-form definition instead; for this purpose, an approximati
can be used. R.W. Gosper proposed the following such approxima-
tion formula:
Explanation / Answer
please rate - thanks
1 question per post, cramster rule
please rate - thanks
#include <iostream>
using namespace std;
int main()
{int i,thousands,hundreds;
cout<<"Please enter an integer >= 1000 and <1000000: ";
cin>>i;
thousands=i/1000;
hundreds=i%1000;
cout<<thousands<<","<<hundreds<<endl;
system("pause");
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.