• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with some code [Easy]  RSS feed

 
Xil Lix
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to programming and Im testing out some stuff.I would like to make a program that lets you input a number and returns the biggest number in a number.

Basically: input = 1234 | return 4

This is my code for now:
 
Vineeth Menon
Ranch Hand
Posts: 79
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Xil,

Welcome to the Ranch. I guess the first thing you should know is that, we do not hand out ready made code in the ranch. That will not help you learn. If you have some problems with your code or logic post it and we'll help you out.

As for your request I'd suggest you pick up a pencil and paper and start from the beginning. If you were the computer how would you go through each and every element and finally get the one that is the biggest of the lot. Once you've got that figured out, we can move to the next step...
 
Xil Lix
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, Im new to these forums.
After thinking for a little bit i found the solution.

 
Vineeth Menon
Ranch Hand
Posts: 79
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great!!! Now that is much better than getting some code that you hardly understand....
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what was the solution?
 
sourav jain
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[MODERATOR ACTION: Deleted (unformatted) full solution.]
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sourav Jain, you must have seen this many times:-
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
It appears on the table of contents page for this forum. It does no good to post a complete solution for somebody else, which is why it has been removed. Besides, it was the OP’s solution we wanted to see.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!