Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main () {
  4.     FILE* fp;
  5.     int i=0, num;
  6.  
  7.     fp = fopen("primers.txt","r");
  8.  
  9.     if (fp) {
  10.  
  11.         fscanf(fp, "%d", &num);
  12.  
  13.         while(!feof(fp)) {
  14.             printf("%d\t", num);
  15.             fscanf(fp, "%d", &num);
  16.         }
  17.  
  18.         fclose(fp);
  19.     } else {
  20.         printf("Fichero no abierto!\n\n");
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement