Advertisement
Kl43z

For/ con tabla y POW

Sep 22nd, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main(){
  4. double monto, principal=1000.0, tasa=.05;
  5. int anio;
  6.  
  7. printf( "%4s%21s\n", "Anio", "Monto del deposito" );
  8. for(anio=1;anio<=10;anio++){
  9. monto=principal*pow(1.0+tasa, anio);
  10. printf("%4d%21.2f\n", anio, monto);
  11. }
  12.  
  13. return 0;
  14. }
  15.  
  16. // no olvidar compilar usando -l m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement