Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6044571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:01:36+00:00 2026-05-23T07:01:36+00:00

I am web developer. I need to create a function to get the posible

  • 0

I am web developer. I need to create a function to get the posible random number for given length of string. Please give the formula for that.

ex:-

1 digit = 10 (0,1,2,3,......9)
2 digit = (00,01,02,...11,12,13,...)

please help me ! Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:01:37+00:00Added an answer on May 23, 2026 at 7:01 am

    The smallest possible value that uses $n$ decimal digits is zero (assuming you don’t allow negative numbers, which I assume you don’t) and the largest is $99\dots 9$, where there are $n$ $9$s. A shorter way of writing that number is $10^n – 1$, so your function should return a list of every number from $0$ to $10^n – 1$.

    In many programming languages this is trivial to write:

    In Python 2.7:

    def sample(n):
        return range(10**n)
    

    In R:

    sample <- function(n) {
        return(seq(0, 10^n-1))
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've used the built-in wizard in Visual Web Developer 2008 to create a simple
We need to create a web-based frontend for displaying some data. The problem is
To give a bit of background, I am asp.net/web form developer learning silverlight. In
I need to provide our web developers an easy and quick way to test
I've developed a web application that worked fine in JBoss 4. Now, I need
I need to develop a web site where I upload videos using the youtube
I develop various web apps, use CSS and JavaScript extensively, and need to be
I am trying to develop a web application for which I need to capture
I'm planning to develop a web service, i need to use in memory cache,
I should to develop a web-application in php for a firm, and I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.