- #1
ChrisVer
Gold Member
- 3,378
- 464
Hi, is there any way to let my C++ program calculate some data and return them as results into a txt file?
For example let's say I want to make a txt with the following things inside:
Is it possible to write in C a program of the form:
and let it somehow extract each k[j] into the text?
For example let's say I want to make a txt with the following things inside:
1
2
3
4
5
Is it possible to write in C a program of the form:
#include <iostream>
#include <cmath>
#include<vector>
using namespace std;
int main(){
int k[5];
k[0]=1;
for (int j=0; j<5; j++)
{
k[j+1]=k[j]+1;
}
return 0;
}
and let it somehow extract each k[j] into the text?
Last edited: