Test program for dprintf.

This commit is contained in:
Ernie Pasveer
2024-05-04 10:46:39 -05:00
parent c9979d2f26
commit 7f01660e96
4 changed files with 61 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#include <string>
#include <iostream>
#include <iomanip>
extern "C" {
void fortranfunction_ (int* count);
}
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;
}
fortranfunction_(&count);
return 0;
}