Files
seer/tests/hellodprintf/hellodprintf.cpp
T

23 lines
443 B
C++
Raw Normal View History

2024-05-04 10:46:39 -05:00
#include <string>
#include <iostream>
#include <iomanip>
2024-05-20 15:50:54 -05:00
#include <stdio.h>
#include <stdarg.h>
2024-05-04 10:46:39 -05:00
int main (int argc, char** argv) {
int count = 10;
int nfact = 1;
int n;
std::cout << " C++ loop" << std::endl;
for (n=1; n<=count; n++) {
nfact = nfact * n;
// printing the value of n and its factorial
std::cout << std::setw(12) << n << std::setw(14) << nfact << std::endl;
}
return 0;
}