|
#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?
|