daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4.  
  5. float polinomio(float x){
  6.     return(pow(x,2)-(5*x)+1);}
  7.  
  8. int main(){
  9.     FILE *entrada;
  10.     FILE *saida;
  11.     float n;
  12.     entrada=fopen("reais.txt","r");
  13.     fscanf(entrada,"%f",&n);
  14.     while(!feof(entrada)){
  15.       fscanf(entrada,"%f",&n);
  16.       saida=fopen("calculof.txt","a");
  17.       fprintf(saida,"%f\n",polinomio(n));}
  18.     fclose(saida);
  19.     fclose(entrada);
  20.     system("pause");}
RAW Paste Data
Top