@Bittu: I wrote that a google years ~= 10^116.5 nanoseconds. If you take the base-10 logarithm of your time t, you will get about 116.5.
Regarding your code, the dynamic range of doubles exceeds 10^116.5, so you can calculate n. However, since n is approximately 2^387, but only the high-order 52 bits is stored, it follows that 1 is insignificant to n; therefore, subtracting 1 (n--) does not change the numerical value of n. Your code will run forever. Dave On May 13, 4:57 am, bittu <shashank7andr...@gmail.com> wrote: > @Dave... I think 1 Googol Year is =10^100 not 10^116.5 ?? why u have > used > > so then we have to write the single line program that googol years of > time ?? & we have processor that can execute the instruction in 10^9 > per second so the time required by googol year in second > which is equals to time t=pow(10,109)*365*86400 sec. > > so program is like > > #include <stdio.h> > #include <math.h> > > int main() { > > double n = pow(10, 109) * 365 * 86400; > > while(n--); > > } > > Correct me if anything wrong??? > > Thanks & Regards > Shashank Mani>>"The Best Way To Escape From The problem is Solve It" > Computer Science & Engg. > BIT Mesra -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.