include <iostream> using namespace std; int main() {double k; int i,n; i=1; cin>>n; while (i<=n) k=k*i; cout<<k; return 0; } code example
Example: #include using namespace std; int main() { int a = 3; float b = 4.5; double c = 5.25; double sum; sum = a + b + c; cout << "The sum of a, b, and c is", sum << endl; return 0; }
#include <iostream>
using namespace std;
int main() {
int a = 3;
float b = 4.5;
double c = 5.25;
double sum;
sum = a + b + c;
cout << "The sum of a, b, and c is", sum << endl;
return 0;
}