josiftepe

Untitled

Dec 31st, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5. int main()
  6. {
  7.     FILE *p = fopen("vlez.txt", "r");
  8.     if(p==NULL)
  9.     {
  10.         printf("Nemoze da se otvori file-ot\n");
  11.         return 0;
  12.     }
  13.     int a,b,c;
  14.     fscanf(p,"%d%d%d",&a,&b,&c);
  15.     int proizvod=a*b*c;
  16.     FILE *o = fopen("proizvod.txt" , "w");
  17.     if (o==NULL)
  18.     {
  19.         printf("Nemoze da se otvori file-ot\n");
  20.         return 0;
  21.     }
  22.     fprintf(o,"%d" , proizvod);
  23.  
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment