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
Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?
Explain about tristate constants?
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
Mention what is the main difference between function and sub-procedure?
What are the different types of operators and their order of precedence?
how to operate webobjects in a webpage using getobject function and then using generic methods?
what is the object hyrarchy in QTP for a web based application
How to get the length of the string by making use of the string function?
how does vb script help in web page designing? explain with example.
How do i automate a website www.flyashx.com without having any test cases witin a week time.
Explain the tristate constants in vbscript?
A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.
Explain the adodb.stream class?
Which operator is used to concatenate the 2 values in the vbscript language?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??