Consider the following values of a and N:
i. = 1, N = 10 (write output to pbla.out) ii. c = 10, N = 10 (write output to pb1b . out) iii. = 10, N = 100 (write output to pblc . out)
(e) For each case plot the numerical solution with the exact solution 011 the same plot
#include <stdio.h>
int main(int argc, char *argv[]) {
(void) argc; (void) argv;
File *pb1a, *pb1b, *pb1c;
pb1a = fopen("pb1a", "wb");
pb1b = fopen("pb1b", "wb");
pb1c = fopen("pb1c", "wb");
for (int i = 0; i < 10; i++)
fprintf(pb1a, "%d ", i);
for (int i = 10; i < 10; i++)
fprintf(pb1b, "%d ", i);
for (int i = 0; i < 100; i += 10)
fprintf(pb1c, "%d ", i);
fclose(pb1a);
fclose(pb1b);
fclose(pb1c);
return 0;
}
Comments
Leave a comment