The source you have written contains wrong logic in several places... Here is a very simple naive source which will give the output you want. But you have to correct the spacing for numbers>10...
Hope this will help.
MooN
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32704
4
posted
0
Thank you for helping, but Prasanna Sheregar would have learned a lot more if you had only pointed out the origin of the errors. It is better to work thing sout for oneself than be given an answer.
pras
Ranch Hand
Joined: Apr 04, 2007
Posts: 188
posted
0
hi can anyone tell me the condition to check for prime numbers.
the numbers are entered from command line
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Let's not talk about prime numbers in this thread, since you have posted the same question in this thread. We try to keep each thread to a single topic.