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
Explain about vb script?
How to create a cookie using vbscript?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
What are the naming conventions while declaring a variable in the vbscript language?
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
Explain different types of segment?
how to write validation function for date in vb script
Write a Script for ATM in QTP
What is loose binding? Why is it not a good practice to use it?
hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?
How can you destroy an object in vbscript?
What is the purpose of regexp object in vbscript?
Compare java script and vb script?
What are the data types supported by vbscript?
Mention what if you do not specify anything when you call a procedure?