Question: Given a program code as below. #include #include #include #define pi 3.1416 void main() FILE*stream; floati,sine; stream=fopen(tests.dat,w+); if(stream==NULL) printf( The file could not be opened);

 Given a program code as below. #include #include #include #define pi

Given a program code as below. #include #include #include #define pi 3.1416 void main() FILE*stream; floati,sine; stream=fopen("tests.dat","w+"); if(stream==NULL) printf(" The file could not be opened"); > for(i=0;i system("cls"); printf(" Sine table was successfully created in A sine - tests.dat"); fclose(stream); > 1. Modify the code to produce a cosine table with 50 entries/lines 2. Modify the code so we can write the file name during execution of the program char string: char num; clrscr'); printf("file name(eg.a:table.dat): "); gets(string); //scanf("%d",&num); stream-fopen(string,"w+")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!