Hi, Anybody could tell me What is the script for Reverse of
Given number. Ex:236--632. Thanks in Advance..

Answer Posted / bragaadeesh

public class RevNum {
public static void main(String args[]){
int sampleNum = 12345678;
System.out.println("Input Num : "+sampleNum);
int reversedNum = 0;
while(sampleNum!=0){
reversedNum = reversedNum*10 + sampleNum%10;
sampleNum = sampleNum/10;
}
System.out.println("Reversed Num : "+reversedNum);
}
}
//SAMPLE OUTPUT
//Input Num : 12345678
//Reversed Num : 87654321

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is select case statement?

602


How regexp.execute method works?

588


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

607


Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

1550


Mention what is the technology used by vb script?

523






How will you check that a variable is an array in vbscript?

543


Explain about tristate constants in vbscript?

614


Explain the asc function?

508


How will you get the largest subscript of an array in vbscript?

604


What is the difference between vbscript and vba?

601


write a program to display configuration of a local system with the help of vb script.

1684


If else for do while select in vb script?

640


Explain the constants in vbscript?

563


Mention what is the main difference between function and sub-procedure?

549


did any one attended interview in applabs if you had gone through plz tell me the procedure

1852