Answer to Question #278574 in C++ for bacthfs

Question #278574

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


1
Expert's answer
2021-12-12T01:17:22-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog