Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  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");}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement