TCS
Company
Logical Reasoning
Coding Decoding
Write numbers from 100 to 365 in a sequence like 100101102103104105... 364365. How many
times the digit 9 occurs in the sequence?
Read Solution (Total 8)
-
- 100 to 200 - 20,
200 to 300 - 20,
300 to 365 -6
20+20+6=46.
ans 46 - 5 years agoHelpfull: Yes(7) No(0)
- starting from 100 count the 9's occurred like 109,119,129...upto 199. In 199 we get 2 9's and fromm 190 to 198 we get nine 9's. Do it upto 200 we get 40 9's. Finally from 300 to 365 count 309,319,329,339,349,359.
Add these 20+20+6 = 46 is the final answer - 5 years agoHelpfull: Yes(4) No(2)
- 24 times it happen.. because it comes this times
- 4 years agoHelpfull: Yes(1) No(0)
- 100 to 200- 20
200 to 300-20
300 to 400-6 - 5 years agoHelpfull: Yes(0) No(0)
- 100 to 190=10 and 191 to 199 =10
200 to 290 =10 and 291 to 299=10
300 to 365 =6
10+10+10+10+6=46 - 4 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int n,i,j,k=0;
for(i=100;i0;j/=10)
{
if(j%10==9)
k++;
}
}
printf("%d",k);
} - 4 years agoHelpfull: Yes(0) No(1)
- 26
100 to 199 9 occurs 11 times
209 to 299 as well 9 occurs 11 times
from 309 to 359 4 times 9 will be there
So 11 + 11 + 4 = 26 - 2 years agoHelpfull: Yes(0) No(1)
- Sorry the answer is 46 not 26
- 2 years agoHelpfull: Yes(0) No(0)
TCS Other Question