Wednesday, October 29, 2008

Google - Project 10 to the 100th.

Project 10100 (pronounced "Project 10 to the 100th") is a call for ideas to change the world by helping as many people as possible. - Extract from the site.

Link: http://www.project10tothe100.com/how_it_works.html

Unfortunately, the idea submission day is over.I believe we can still make a difference by voting.

Google 10 years story.

It is worth reading how Google made it's way till here.
Check the link http://www.google.com/tenthbirthday/#start

The story has links to some good materials.

Tuesday, October 7, 2008

Given a number 'n'. Find the number of trailing zeros in n factorial.

Technique:
Number of Trailing zeros = floor(num / 5) + floor(num / 5^2) + floor(num / 5^3) + ....

#include <>
using namespace std;
void main()
{
int n;
printf("Enter a value : ");
scanf("%d", &n);

int cntOfZero = 0;
int powersof5 = 5;
while ( n / powersof5 )
{
cntOfZero += n / powersof5;
powersof5 *= 5;
}
printf("Num of zeros : %d\n", cntOfZero);
}