TO PRINT LUCKY NUMBERSfrom 1 to 50
Page 1 of 1
11 Replies - 7078 Views - Last Post: 23 February 2010 - 08:36 AM
#1
TO PRINT LUCKY NUMBERS
Posted 25 October 2008 - 09:24 PM
I have no idea about the logic help!!!! plz
the out will be
[1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49]
the out will be
[1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49]
Replies To: TO PRINT LUCKY NUMBERS
#2
Re: TO PRINT LUCKY NUMBERS
Posted 25 October 2008 - 11:11 PM
how can anyone answer this?
System.out.print(" 1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49 ");
System.out.print(" 1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49 ");
This post has been edited by absynthe: 25 October 2008 - 11:13 PM
#3
Re: TO PRINT LUCKY NUMBERS
Posted 26 October 2008 - 09:56 AM
I think you're looking to output odd numbers~
Try this:
Try this:
for (int i = 1; i < 50; i += 2) {
System.out.print(i.toString() + " ");
#4
Re: TO PRINT LUCKY NUMBERS
Posted 26 October 2008 - 08:46 PM
#5
Re: TO PRINT LUCKY NUMBERS
Posted 26 October 2008 - 08:47 PM
I think the program is supposed to output random numbers between 1-49 and all being unique.
Not sure though.
Actually maybe not.
Nevermind.
Not sure though.
Actually maybe not.
Nevermind.
This post has been edited by westforduk: 26 October 2008 - 08:48 PM
#6
Re: TO PRINT LUCKY NUMBERS
Posted 26 October 2008 - 09:19 PM
If priya_lorha tells us what a "lucky number is may be we can help
#7
Re: TO PRINT LUCKY NUMBERS
Posted 26 October 2008 - 10:27 PM
The series goes in this order, the numbers are from 1 to 50.
The incrementation goes like this, +2, +4, +2,+4, +2, +6 and so on. Hope this clears the logical part.
I don't know how to put the code for it.
The incrementation goes like this, +2, +4, +2,+4, +2, +6 and so on. Hope this clears the logical part.
I don't know how to put the code for it.
This post has been edited by SanjitVignesh: 26 October 2008 - 10:28 PM
#8
Re: TO PRINT LUCKY NUMBERS
Posted 27 October 2008 - 05:19 PM
#9
Re: TO PRINT LUCKY NUMBERS
Posted 28 October 2008 - 05:56 AM
The logic is, from the series from 1 to 100 remove all the 2nd numbers, i.e.
1,3,5,7,9,11, ......
From the remaining numbers remove every third number i.e.
1,3,7,9,......
From the remaining remove every 4th number i.e.
1,3,7,......
this way the logic will proceed....
1,3,5,7,9,11, ......
From the remaining numbers remove every third number i.e.
1,3,7,9,......
From the remaining remove every 4th number i.e.
1,3,7,......
this way the logic will proceed....
#10
Re: TO PRINT LUCKY NUMBERS
Posted 28 October 2008 - 06:08 AM
Lucky numbers or not, I think we have to consider amitdhar the winner here.. And the prize is.. Sorry, no prize.. 
Anyways, you use a boolean array[100], I'll use coffee..
Anyways, you use a boolean array[100], I'll use coffee..
#11 Guest_Saswat*
Re: TO PRINT LUCKY NUMBERS
Posted 13 February 2010 - 12:33 PM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38..
(reject the +2 position no.s from the above series)
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73.
(reject the +3 position no.s from the above series)
1 3 7 9 13 15 19 21 25 27 31 33 37 39 43 45 49 51 55 57 61 63 67 69 73..
(reject the +4 position no.s from the above series)
1 3 7 13 15 19 25 27 31 37 39 43 49 51 55 61 63 67 73...
(reject the +5 position no.s from the above series)
1 3 7 13 19 25 27 31 39 43 49 51 61 63 67 73...
(reject the +6 position no.s from the above series)
1 3 7 13 19 27 31 39 43 49 61 63 67 73...
(reject the +7 position no.s from the above series)
1 3 7 13 19 27 39 43 49 61 63 67...
(reject the +8 position no.s from the above series)
1 3 7 13 19 27 39 49 61 63 67...
(reject the +9 position no.s from the above series)
1 3 7 13 19 27 39 49 63 67...
(reject the +10 position no.s from the above series)
1 3 7 13 19 27 39 49 63 ..
(reject the +2 position no.s from the above series)
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73.
(reject the +3 position no.s from the above series)
1 3 7 9 13 15 19 21 25 27 31 33 37 39 43 45 49 51 55 57 61 63 67 69 73..
(reject the +4 position no.s from the above series)
1 3 7 13 15 19 25 27 31 37 39 43 49 51 55 61 63 67 73...
(reject the +5 position no.s from the above series)
1 3 7 13 19 25 27 31 39 43 49 51 61 63 67 73...
(reject the +6 position no.s from the above series)
1 3 7 13 19 27 31 39 43 49 61 63 67 73...
(reject the +7 position no.s from the above series)
1 3 7 13 19 27 39 43 49 61 63 67...
(reject the +8 position no.s from the above series)
1 3 7 13 19 27 39 49 61 63 67...
(reject the +9 position no.s from the above series)
1 3 7 13 19 27 39 49 63 67...
(reject the +10 position no.s from the above series)
1 3 7 13 19 27 39 49 63 ..
#12 Guest_vicks_sid*
Re: TO PRINT LUCKY NUMBERS
Posted 23 February 2010 - 08:36 AM
Saswat, on 13 February 2010 - 11:33 AM, said:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38..
(reject the +2 position no.s from the above series)
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73.
(reject the +3 position no.s from the above series)
1 3 7 9 13 15 19 21 25 27 31 33 37 39 43 45 49 51 55 57 61 63 67 69 73..
(reject the +4 position no.s from the above series)
1 3 7 13 15 19 25 27 31 37 39 43 49 51 55 61 63 67 73...
(reject the +5 position no.s from the above series)
1 3 7 13 19 25 27 31 39 43 49 51 61 63 67 73...
(reject the +6 position no.s from the above series)
1 3 7 13 19 27 31 39 43 49 61 63 67 73...
(reject the +7 position no.s from the above series)
1 3 7 13 19 27 39 43 49 61 63 67...
(reject the +8 position no.s from the above series)
1 3 7 13 19 27 39 49 61 63 67...
(reject the +9 position no.s from the above series)
1 3 7 13 19 27 39 49 63 67...
(reject the +10 position no.s from the above series)
1 3 7 13 19 27 39 49 63 ..
(reject the +2 position no.s from the above series)
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73.
(reject the +3 position no.s from the above series)
1 3 7 9 13 15 19 21 25 27 31 33 37 39 43 45 49 51 55 57 61 63 67 69 73..
(reject the +4 position no.s from the above series)
1 3 7 13 15 19 25 27 31 37 39 43 49 51 55 61 63 67 73...
(reject the +5 position no.s from the above series)
1 3 7 13 19 25 27 31 39 43 49 51 61 63 67 73...
(reject the +6 position no.s from the above series)
1 3 7 13 19 27 31 39 43 49 61 63 67 73...
(reject the +7 position no.s from the above series)
1 3 7 13 19 27 39 43 49 61 63 67...
(reject the +8 position no.s from the above series)
1 3 7 13 19 27 39 49 61 63 67...
(reject the +9 position no.s from the above series)
1 3 7 13 19 27 39 49 63 67...
(reject the +10 position no.s from the above series)
1 3 7 13 19 27 39 49 63 ..
hey someone give the java program code to run this lucky no. process....
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote











|