Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- FILE* fpoint;
- float A[4];
- float L[4] = { 1.7,2.3,4.6,7.8};
- float W[4] = { 5.2,4.1,1.6,6.8 };
- fopen_s(&fpoint, "I:\\test\\calculation.dat", "a");
- for (int i = 0; i < 4; i++)
- {
- A[i] = L[i] * W[i];
- printf("\n%d L=%0.2f W=%0.2f A=%0.2f",i+1, L[i], W[i], A[i]);
- fprintf_s(fpoint, "\n%d L=%0.2f W=%0.2f A=%0.2f",i+1, L[i], W[i], A[i]);
- }
- fclose(fpoint);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement