mirror of
https://github.com/epasveer/seer.git
synced 2026-08-31 09:30:41 +08:00
Test program for dprintf.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user