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#
  4. Generate random number

Generate random number

Scheduled Pinned Locked Moved C#
5 Posts 4 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
    shamsteady
    wrote on last edited by
    #1

    How can i generate random number in C#?

    S E 2 Replies Last reply
    0
    • S shamsteady

      How can i generate random number in C#?

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Random on = new Random(); int num = on.Next(1, 100); 1 and 100 is min and max limit

      Thanks and Regards Sandeep If you want something you never had, do something you have never done!

      S 1 Reply Last reply
      0
      • S Sandeep Akhare

        Random on = new Random(); int num = on.Next(1, 100); 1 and 100 is min and max limit

        Thanks and Regards Sandeep If you want something you never had, do something you have never done!

        S Offline
        S Offline
        shamsteady
        wrote on last edited by
        #3

        Thank you very much..

        1 Reply Last reply
        0
        • S shamsteady

          How can i generate random number in C#?

          E Offline
          E Offline
          Ennis Ray Lynch Jr
          wrote on last edited by
          #4

          I always use the hard-coded value of three. You can't really prove its not random. Some people insist on System.Random but I don't trust it.


          File Not Found

          B 1 Reply Last reply
          0
          • E Ennis Ray Lynch Jr

            I always use the hard-coded value of three. You can't really prove its not random. Some people insist on System.Random but I don't trust it.


            File Not Found

            B Offline
            B Offline
            b0ksah
            wrote on last edited by
            #5

            42 FTW ...

            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