vb.net - How to check for prime numbers -
The following code lists all the major numbers from 1 to 10:
Dim primeN As integer prime prime minister, Prime Minister as Prime Minister = Prime Minister = 1 to 10 = Prime Minister = Prime Minister = 2 Prime Minister = 2 Prime Minister / 2 If PrimeNen Prime Minister = 0 then Prime Falg = wrong ends if the next The prime flags then the console. These (PM) is next Kansolkridlain () How can I change my order to user input reads and checks that it is a prime number is finished?
Instead of a loop you are almost there, just get user input and put it in that variable again Change your message in a little while.
code:
Integer as the prime prime minister Boolean PrimeN = int 32. Perse (Console.Readline ()) as Prime Prime Primelight = True Prime Minister = PrimeN / 2 for PM 2 = prime = prime then = primeflag = wrong end if the next primeflag is then console.lightline ("prime") is the als console. Light line ("not prime") end if console.readline ( ) others Like them, it is suggested that logic in a method would be a good idea.
Comments
Post a Comment