Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 16-01-2008, 09:35 AM   #1 (permalink)
M$™ Certified Spammer
 
entrana's Avatar
 
Join Date: Jun 2007
Location: Kolkata
Posts: 1,751
Default help in java homework anyone?


i need a simple program, i think using for loop, to find odd numbers till a specified number using command line argument. like i want to find out all odd numbers till 10.
__________________
Seagate 500gb 7200RPM l Corsair 2*1GB Ram 800mhz l XFX 8800 GTS 320MB Xtreme 650/ 1500/ 950 l Asus P5N-eSLI l Core 2 Duo e6750 l Coolermaster Extreme Power 600watts SMPS l Microtek 800VA Ups l
entrana is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 17-01-2008, 02:57 PM   #2 (permalink)
M$™ Certified Spammer
 
entrana's Avatar
 
Join Date: Jun 2007
Location: Kolkata
Posts: 1,751
Default Re: help in java homework anyone?

aww cmon im sure u people know java
__________________
Seagate 500gb 7200RPM l Corsair 2*1GB Ram 800mhz l XFX 8800 GTS 320MB Xtreme 650/ 1500/ 950 l Asus P5N-eSLI l Core 2 Duo e6750 l Coolermaster Extreme Power 600watts SMPS l Microtek 800VA Ups l
entrana is offline  
Old 17-01-2008, 06:15 PM   #3 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: help in java homework anyone?

Code:
class Odd
{
    public static void main(String args[])
    {
        int i=Integer.parseInt(args[0]);
        for(int count=1;count<=i;count+=2)
        {
            System.out.println(count);
        }
    }
}
Execute:
Code:
java Odd 9
Output:
Code:
1
3
5
7
9
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 17-01-2008, 06:27 PM   #4 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: help in java homework anyone?

Qwerty man how many languages do u know???
Pathik is offline  
Old 17-01-2008, 07:01 PM   #5 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: help in java homework anyone?

Just a few, why?
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 17-01-2008, 07:08 PM   #6 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: help in java homework anyone?

Just asking. Cos you r very good at programming.
Pathik is offline  
Old 18-01-2008, 09:54 AM   #7 (permalink)
M$™ Certified Spammer
 
entrana's Avatar
 
Join Date: Jun 2007
Location: Kolkata
Posts: 1,751
Default Re: help in java homework anyone?

thanks
__________________
Seagate 500gb 7200RPM l Corsair 2*1GB Ram 800mhz l XFX 8800 GTS 320MB Xtreme 650/ 1500/ 950 l Asus P5N-eSLI l Core 2 Duo e6750 l Coolermaster Extreme Power 600watts SMPS l Microtek 800VA Ups l
entrana is offline  
Old 18-01-2008, 05:30 PM   #8 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: help in java homework anyone?

What did you find difficult in writing this one that you had to ask though?

Or is it just laziness?
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 20-01-2008, 03:11 PM   #9 (permalink)
M$™ Certified Spammer
 
entrana's Avatar
 
Join Date: Jun 2007
Location: Kolkata
Posts: 1,751
Default Re: help in java homework anyone?

couldnt figure out that count+=2 thing. i was trying count+2
__________________
Seagate 500gb 7200RPM l Corsair 2*1GB Ram 800mhz l XFX 8800 GTS 320MB Xtreme 650/ 1500/ 950 l Asus P5N-eSLI l Core 2 Duo e6750 l Coolermaster Extreme Power 600watts SMPS l Microtek 800VA Ups l
entrana is offline  
Old 20-01-2008, 03:16 PM   #10 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: help in java homework anyone?

Quote:
Originally Posted by entrana View Post
couldnt figure out that count+=2 thing. i was trying count+2
lol thats the basic (didnt u learn C ?)
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 20-01-2008, 03:40 PM   #11 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: help in java homework anyone?

count+=2 is similar to count=count+2
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 23-01-2008, 03:32 PM   #12 (permalink)
Mad and Furious
 
redhat's Avatar
 
Join Date: May 2006
Location: Visual Basic 6.0
Posts: 453
Default Re: help in java homework anyone?

@entrana : I suppose ur still in school...

What grade are u in?
PM me....
redhat is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java programming..how can I distribute java program....? Manojap Programming 5 16-05-2009 02:46 PM
Little Homework Help hitman050 QnA (read only) 5 14-06-2007 04:13 PM
Computer Holiday Homework : Help !! GeekyBoy QnA (read only) 27 14-06-2007 02:17 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2