@rodentjeFeb 16.2005 — #with java it'll be something like this: [code=php]import java.io.*; public class goTenUp{ public static void main(String args[] throws IOException { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader in = new BufferedReader(isr); System.out.println("Give a number"); String s = in.readLine(); int replace = Integer.parsInt(s.charAt(s.length()-1))+1; s = s.replace(s.charAt(s.length()-1),s.charAt(s.length()-1),replace); if(s.charAt(s.length())!=0){ s = s.replace(s.charAt(s.length()),s.charAt(s.length()),'0'); } System.out.println("The next multiple of ten = "+s); } }[/code]
I don't know exactly what you want, 31 results in 40, but 30 results in 30 or 40?? Otherwise, delete the if(...){...}
There could be some errors in it, haven't tested it yet...
@PittimannFeb 16.2005 — #Hi![i]Originally posted by rodentje [/i]
[B]hmmmm, warren's solution looks a bit easier i guess ? [/B][/QUOTE]But it rounds down (i. e.: 34 would result in 30). According to the question, 30 to 39 should result in 40...