#include <stdio.h>


int main() {

FILE * fr;  /* read from */
FILE * fw;  /* write to */

int status;
int n;

fr = fopen("test.txt", "r");
fw = fopen("out.txt", "w");

do {

  status = fscanf(fr, "%d", &n);
  if (status != EOF) { 
    fprintf(fw, "Square of %d is %d\n", n, n*n);
  }
} while (status != EOF);



fclose(fr);
fclose(fw);

return 0;
}