Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Escribir un algoritmo que, dado un capital C y un interés anual R,
- averigüe al cabo de cuántos años se doblará dicho capital. */
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- float c,r,g;
- int anyo=0;
- printf(" Introduzca capital e interes separados por un espacio: ");
- scanf("%f %f",&c,&r);
- r=r*0.01;
- g=c;
- while(g<2*c){
- g=(g*r)+g;
- anyo++;
- }
- printf("\n Se doblara en %d anyos \n \n ",anyo);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement