Advertisement
Pavle_nis

fajlovi 1

May 4th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. // Fajlovi 1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <stdio.h>
  6.  
  7. int main()
  8. {
  9.     int br;
  10.     FILE *fp, *fa;
  11.  
  12.     fp = fopen("podaci.txt", "r");
  13.     fa = fopen("abspodaci.txt", "w");
  14.  
  15.     while (!feof(fp))
  16.     {
  17.         fscanf(fp, "%d", &br);
  18.         fprintf(fa, "%d\n", abs(br));
  19.     }
  20.  
  21.     fclose(fp);
  22.     fclose(fa);
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement