Here is my code for getting the root of 2
#include <stdio.h>
unsigned long long root(int n);
int main()
{
int n,i;
unsigned long long c;
n=10;
for(i=1;i<=n;i++)
{
c=root(i);
printf("%d decimal digits:%llu\n",i,c);
}
return 0;
}
unsigned long long root(int n)
{ unsigned long long int m,d;
d=pow(10,n);
m=2*pow(10,2*n);
while (pow(d,2)<=m)
{
d++;
}
return d-1;
}
Unsigned long long int can support from 0 to $2^64-1$. I think this enough to calculate 10 digits decimal.
I expect the output of 10 digits decimal should be 14142135623