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
What is select case statement?
How regexp.execute method works?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
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 ?
Mention what is the technology used by vb script?
How will you check that a variable is an array in vbscript?
Explain about tristate constants in vbscript?
Explain the asc function?
How will you get the largest subscript of an array in vbscript?
What is the difference between vbscript and vba?
write a program to display configuration of a local system with the help of vb script.
If else for do while select in vb script?
Explain the constants in vbscript?
Mention what is the main difference between function and sub-procedure?
did any one attended interview in applabs if you had gone through plz tell me the procedure