Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Count the Digits in Number

This is a discussion on Count the Digits in Number within the C and C++ forums, part of the Software Development category; Is there any lib. function that will count the number of digits in a number....

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 07-15-2009
Junior Member
 
Join Date: Dec 2008
Location: MALERKOTLA
Posts: 9
Thanks: 3
Thanked 2 Times in 2 Posts
mani_2u4u is on a distinguished road
Count the Digits in Number

Is there any lib. function that will count the number of digits in a number.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-29-2009
Junior Member
 
Join Date: Jul 2009
Location: SN Road, Bolpur, Birbhum
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
TANMOYPALIT is on a distinguished road
Re: Count the Digits in Number

NO
but you can build a header file and write the function
Reply With Quote
  #3 (permalink)  
Old 09-29-2009
Expert Member
 
Join Date: Dec 2006
Location: Chennai
Posts: 203
Thanks: 2
Thanked 17 Times in 15 Posts
Barbie is on a distinguished road
Re: Count the Digits in Number

strlen can be used for this
Reply With Quote
  #4 (permalink)  
Old 10-08-2009
Junior Member
 
Join Date: Mar 2009
Location: COIMBATORE
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sumitsolution is on a distinguished road
Re: Count the Digits in Number

strlen will not work..
use
count=0;
while(n>0){
count++;
n=n/10;
}
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Count Total Number of Flights sudhirzpatil QTP 2 02-02-2009 01:57 PM
Create a variable to Count each time the User enters a number imartel86 C and C++ 0 09-20-2008 05:00 PM
Count Number of records through File-Aid appyprat MainFrame 1 09-16-2008 01:11 PM
Count the Digits sowji_mca Mathematical Puzzles 3 07-20-2008 06:41 PM
Count number of rows in excel sheet chanduU QTP 4 04-08-2008 01:13 AM


All times are GMT -4. The time now is 08:35 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved