Advertisement
Guest User

manoel2dOtFile

a guest
Apr 16th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.  int array[5][5];
  7.  int num;
  8.  int i,j;
  9.  FILE *fp;
  10.  char textFile[100];
  11.  scanf("%s", textFile);
  12.  fp=fopen(textFile, "r");
  13.  
  14.  for(i=0;i<3; i++)
  15.  {
  16.      for(j=0; j<3; j++)
  17.      {
  18.          fscanf(fp,"%d", &array[i][j]);
  19.      }
  20.      printf("\n");
  21.  }
  22.  
  23.  for(i=0;i<3; i++)
  24.  {
  25.      for(j=0; j<3; j++)
  26.      {
  27.          printf("%d ", array[i][j]);
  28.      }
  29.      printf("\n");
  30.  }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement