Help with Smalltalk, please!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with Smalltalk, please!

pablovieira10
#include <stdio.h>

float fatorial(float num) {
    if(num==1) return 1;
    else
        return num * fatorial(num - 1);
}

int main(void) {
    float n, n1, E=0;
    int i;

    scanf("%f %f", &n, &n1);
    E= 1 + 1/fatorial(n) + 1/fatorial(n1);
    for(i=1; i<4; i++) {
             printf("\tValor dos %d primeiros termos e': %.2f\n",(i+2), E);
             if(i<3) {
                     scanf("%f", &n1);
             }
             E= E + 1/fatorial(n1);
    }

    system("PAUSE");
}

I need to pass this program for Smalltalk, the code is currently in C.
But I can not make divisions, how do I?
Reply | Threaded
Open this post in threaded view
|

Re: Help with Smalltalk, please!

pablovieira10
I can not read data from the keyboard too. If someone can assist me in this!