Turn your Mobile Apps into m-commerce apps – Learn More!

You're Browsing As A Guest! Register Now...
Become a VB.NET Expert!

Join 415,717 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 831 people online right now.Registration is fast and FREE... Join Now!



Page 1 of 1
  • You cannot start a new topic
  • Reply Reply

Console application program how to display prime numbers Rate Topic: -----

#1 beginer  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-January 08


Dream Kudos: 0

Share |

Console application program

Posted 03 January 2008 - 01:43 AM

as i am a beginer as of vb.net i have a assignment to generate prime number from 4-72
to check whether the entered number is armstrong or not.

:crazy:
thanx!
Was This Post Helpful? 0
  • +
  • -


#2 beginer  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-January 08


Dream Kudos: 0

Re: Console application program

Posted 03 January 2008 - 02:25 AM

dim num, div as integer
sub main ()
writeline("enter the number")
num=readline()
div=2
while(div<num)
if(num mod div = 0)
writeline("num is non prime")
read()
exit sub
end if
div=div+1
end while
writeline("number is prime")
read()




i have tried this one...but this for checking whether the number is prime or not but i dont know how to generate a list.

Edit: Please use code tags when posting code, like so => :code:

This post has been edited by PsychoCoder: 04 January 2008 - 09:10 PM

Was This Post Helpful? 0
  • +
  • -

#3 ferrari12508  Icon User is offline

  • D.I.C Lover
  • Icon

Reputation: 3
  • View blog
  • Posts: 1,115
  • Joined: 02-November 07


Dream Kudos: 150

Re: Console application program

Posted 04 January 2008 - 06:43 PM

well you could use a label from the toolbox and just have
label1.text = Num.tostring


just put that at the end of your code once it has gotten whether it is prime or not. If you want to generate a list, than do :
label1.text = label1.text & ControlChars.NewLine & Num.tostring


This post has been edited by ferrari12508: 04 January 2008 - 06:45 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1
  • You cannot start a new topic
  • Reply Reply


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users