Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Plz solve it

Plz solve it

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SARKER MD KAWSER ALOM
    wrote on last edited by
    #1

    Count the digits of a given number c programming

    K D A V J 5 Replies Last reply
    0
    • S SARKER MD KAWSER ALOM

      Count the digits of a given number c programming

      K Offline
      K Offline
      k5054
      wrote on last edited by
      #2

      Ok. Did that. Did you?

      Keep Calm and Carry On

      1 Reply Last reply
      0
      • S SARKER MD KAWSER ALOM

        Count the digits of a given number c programming

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        That's not how it works around here. We're not here to do your work for you. We'll help you with your code if you got specific questions or problems, but that's it.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        1 Reply Last reply
        0
        • S SARKER MD KAWSER ALOM

          Count the digits of a given number c programming

          A Offline
          A Offline
          Aghast nj
          wrote on last edited by
          #4

          Quote:

          Count the digits of a given number c programming

          You don't specify what kind of number it is (floating point, integer), nor how it is provided. Is the number coming in as a string, for example from ``argv`` passed to ``main``? Is the number passed in to a function as a parameter? Does the function need a particular name? Is the number allowed to be negative? Is there a maximum value for the number? Will there be decimal points? Is the number base 10, or base 2, or base 16, or is there a prefix at the front that specifies the radix? What should the result be if no number is given, or an invalid number is given? Are there any unit test cases that would provide a good example of how this is supposed to work?

          1 Reply Last reply
          0
          • S SARKER MD KAWSER ALOM

            Count the digits of a given number c programming

            V Offline
            V Offline
            Victor Nijegorodov
            wrote on last edited by
            #5

            SARKER MD KAWSER ALOM wrote:

            Count the digits of a given number c programming

            First try to count the digits of a given number without c programming. Only with a peace of paper and a pencil!

            1 Reply Last reply
            0
            • S SARKER MD KAWSER ALOM

              Count the digits of a given number c programming

              J Offline
              J Offline
              Jerry Jeremiah
              wrote on last edited by
              #6

              #include #include int main() {
              int number = 1234567;
              int digits = log10(number)+1;
              printf("%d has %d digits\n",number,digits);
              }

              Try it here[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups