top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In a colony a sign maker got the contract to mark the buildings from number 1 to 500. How many zeroes will he need?

0 votes
352 views

A new colony was built and a sign maker got the contract to mark the buildings from number 1 to 500. How many zeroes will he need?

posted Dec 24, 2016 by anonymous

Share this puzzle
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

91 using a spread sheet and counting; perhaps a computer program will be more authentic.

answer Dec 25, 2016 by Kewal Panesar
#include<stdio.h>
#include<math.h>

int main()
{
    int a=1,b,count=0;
    float c;
    for(a=1;a<501;a++)
    {
        b=a;
        while(b>0)
        {
            c=fmod(b,10);
            if(c==0)
            {
                count++;
            }
            b=b/10;
        }
    }
   
    printf("%d number of zeros are present between 1 to 500\n",count);
}
The above code gave the same answer



Similar Puzzles
0 votes

There are two buildings P and Q.
If 35 persons sent from P to Q, then the number of persons in each building is the same.
If 60 persons are sent from Q to P, then the number of persons in P is double the number of persons in Q.
How many persons are there in building in P?

0 votes

Its a 5 digit number where…
1st digit denotes how many zeroes are there in the number
2nd digit denotes how many ones are there in the number
3rd digit denotes how many twos are there in the number
4th digit denotes how many threes are there in the number
5th digit denotes how many fours are there in the number

0 votes

A student got 90% marks in an exam of 500 marks.
If marks of physics are printed 94 instead of 72, then what will be the true % obtained by the student?

0 votes

How many seconds will a 500 metre long train take to cross a man walking with a speed of 3 km/hr in the direction of the moving train if the speed of the train is 63 km/hr?

...