hello,
I have to calculate the mathetical e.
So I have this :
Code:
*/
#include <stdio.h>
int
main ( int argc, char *argv[] )
{
int n, teller ;
float uitkomst=0;
printf ("Enter n : ");
scanf ("%d", &n);
printf( "n is : %d ", n);
for (teller=1; teller <=n; teller++)
{
uitkomst = 1 / teller;
printf (" uitkomst is : %f \n", uitkomst);
}
printf ("e is ongeveer : %f", uitkomst);
return 0 ;
} /* ---------- end of function main ---------- */
But the rule uitkomst = 1/ teller gives as output always zero and not 1/2 , 1/3
What am I doing wrong now.
Roelof