Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(int argc,char** argv){
- //Open File
- FILE* f = fopen("plotdata","w");
- if(!f){return -1;}
- //Write Graph1
- for(double x=0;x<=10;x+=1){
- double y = x*x;
- fprintf(f,"%lf %lf \n",x,y);
- }
- //Separate data-block by 2 new lines
- fprintf(f,"\n\n");
- //Write Graph2
- for(double x=0;x<=10;x+=1){
- double y = x*x*x;
- fprintf(f,"%lf %lf \n",x,y);
- }
- //Close File
- fclose(f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement