[ create a new paste ] login | about

Link: http://codepad.org/miPK6of4    [ raw code | output | fork ]

C, pasted on Oct 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
#include <math.h>
void main() {
	int i;
	double x,y;
	x=100;
	for(i=0;i<10;i++)
{
		y=x*(sqrt(x*x+1)-x);
		printf("X %f  Valore :%f \n",x,y);
	x*=10;
}

}


Output:
1
2
3
4
5
6
7
8
9
10
X 100.000000  Valore :0.499988 
X 1000.000000  Valore :0.500000 
X 10000.000000  Valore :0.500000 
X 100000.000000  Valore :0.500000 
X 1000000.000000  Valore :0.500000 
X 10000000.000000  Valore :0.500004 
X 100000000.000000  Valore :0.499858 
X 1000000000.000000  Valore :0.523869 
X 10000000000.000000  Valore :0.000000 
X 100000000000.000000  Valore :0.000000 


Create a new paste based on this one


Comments: