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. Other Discussions
  3. The Weird and The Wonderful
  4. It's Primes as far as the eye can see!

It's Primes as far as the eye can see!

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
44 Posts 12 Posters 1 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.
  • I Ian Shlasko

    It was renamed... In 2620. Don't you watch Futurama?

    Proud to have finally moved to the A-Ark. Which one are you in?
    Author of the Guardians Saga (Sci-Fi/Fantasy novels)

    N Offline
    N Offline
    newton saber
    wrote on last edited by
    #41

    I haven't watched Futurama, because I boycotted The Simpsons in Season 2 and haven't watched anything by Matt Groening since. I know. Pretty cool, huh?

    1 Reply Last reply
    0
    • OriginalGriffO OriginalGriff

      This is the whole of a would-be Tip submitted today:

      public class Class1
      {
      static void Main(string[] args)
      {
      Console.WriteLine("Enter a Number");
      int num = int.Parse(Console.ReadLine());
      for (int i = 1; i <=num ; i++)
      {
      if(i==2)
      Console.WriteLine(2);

                  if (i % 2 != 0)
                  {
                      Console.WriteLine(i);
                  }
              }
      
           }
      }
      

      No text, no explanation - the author (I can only assume he works for Mindfire, it's about their level) clearly felt that it spoke for itself. And boy, does it ever! This, ladies-n-gentlemen, is a Prime Number generator according to the author. So...I tried it... According to this code, the prime numbers under 26 are:

      1
      2
      3
      5
      7
      9
      11
      13
      15
      17
      19
      21
      23
      25

      Now, call me old fashioned, but in my day, 9, 15 and 21 were divisible by 3, and both 15 and 25 were divisible by 5... So which is wrong? The Code? Or the Laws of Mathematics? Only the author can tell... :laugh:

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      P Offline
      P Offline
      PaulLinton
      wrote on last edited by
      #42

      What's the problem? That lists all the primes less than 26. It also lists some other numbers as well, no extra charge.

      1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        This is the whole of a would-be Tip submitted today:

        public class Class1
        {
        static void Main(string[] args)
        {
        Console.WriteLine("Enter a Number");
        int num = int.Parse(Console.ReadLine());
        for (int i = 1; i <=num ; i++)
        {
        if(i==2)
        Console.WriteLine(2);

                    if (i % 2 != 0)
                    {
                        Console.WriteLine(i);
                    }
                }
        
             }
        }
        

        No text, no explanation - the author (I can only assume he works for Mindfire, it's about their level) clearly felt that it spoke for itself. And boy, does it ever! This, ladies-n-gentlemen, is a Prime Number generator according to the author. So...I tried it... According to this code, the prime numbers under 26 are:

        1
        2
        3
        5
        7
        9
        11
        13
        15
        17
        19
        21
        23
        25

        Now, call me old fashioned, but in my day, 9, 15 and 21 were divisible by 3, and both 15 and 25 were divisible by 5... So which is wrong? The Code? Or the Laws of Mathematics? Only the author can tell... :laugh:

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

        T Offline
        T Offline
        TheGreatAndPowerfulOz
        wrote on last edited by
        #43

        You and your old-fashioned ideas of what a prime is.... :~ :rolleyes:

        If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
        You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun
        Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          This is the whole of a would-be Tip submitted today:

          public class Class1
          {
          static void Main(string[] args)
          {
          Console.WriteLine("Enter a Number");
          int num = int.Parse(Console.ReadLine());
          for (int i = 1; i <=num ; i++)
          {
          if(i==2)
          Console.WriteLine(2);

                      if (i % 2 != 0)
                      {
                          Console.WriteLine(i);
                      }
                  }
          
               }
          }
          

          No text, no explanation - the author (I can only assume he works for Mindfire, it's about their level) clearly felt that it spoke for itself. And boy, does it ever! This, ladies-n-gentlemen, is a Prime Number generator according to the author. So...I tried it... According to this code, the prime numbers under 26 are:

          1
          2
          3
          5
          7
          9
          11
          13
          15
          17
          19
          21
          23
          25

          Now, call me old fashioned, but in my day, 9, 15 and 21 were divisible by 3, and both 15 and 25 were divisible by 5... So which is wrong? The Code? Or the Laws of Mathematics? Only the author can tell... :laugh:

          Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #44

          Looks like OP is trying to get odd numbers and two.

          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