Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / deepak agrawal

int reverse=0;
while(digit)
{
reverse*=10;
reverse+=digit%10;
digit/=10;
}

Is This Answer Correct ?    12 Yes 2 No

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

Answer / 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

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

Answer / srinu

dim str,cnt,rstr,i
str="236"
cnt=len(str)
for i=1 to cnt
rstr=mid(str,i,1) & rstr
next
msgbox rstr

Is This Answer Correct ?    5 Yes 0 No

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

Answer / amol zambre

str="236--678"
cnt=len(str)
for i=1 to cnt
rstr=mid(str,i,1) & rstr
next
msgbox rstr

Is This Answer Correct ?    1 Yes 0 No

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

Answer / test

dim a
a=StrReverse(123)
msgbox a

Is This Answer Correct ?    1 Yes 0 No

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

Answer / rohit_allinterview

int reverse(int num)
{
int temp,num2=0;
printf("Original number is %d",num);
while(num!=0)
{
temp=num%10;
num=num/10;

num2=num2+temp;
num2=num2*10;
}

num=num2/10;
printf("Reversed Number is %d",num);
}

// Incase of any mistake or doubt plz drop mailto
rohit_vit2020@yahoo.co.in

Is This Answer Correct ?    0 Yes 0 No

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

Answer / anonimous

public int reverse (int num){
String b = Integer.toString(num);
char [] aa = b.toCharArray();
char []cc = new char [aa.length];
for (int m = 0; m < aa.length; m++)
cc[m] = aa[aa.length - 1 - m];

return Integer(String.valueOf(cc));
}

Is This Answer Correct ?    0 Yes 0 No

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

Answer / parvez

'You can reverse any string with char, num and spl
characters with this code!

Sub StinrgReverse()

Dim sString, sRevString

sString = InputBox("Enter your string: ")
MsgBox sString
sRevString = fStringReverse(sString)
MsgBox sRevString
End Sub

Function fStringReverse(ByVal sBeforeRev)

Dim aStrSplit, sAfterSplit, sAfterRev, aStrRev

iLength = Len(sBeforeRev) - 1
ReDim aStrSplit(iLength) 'Very Important

For i = 0 To iLength
aStrSplit(i) = Mid(sBeforeRev, i + 1, 1)
Next

ReDim aStrRev(iLength) 'Very Important
For j = 0 To iLength
aStrRev(j) = aStrSplit(iLength - j)
Next

sAfterSplit = Join(aStrSplit, ".")
sAfterRev = Join(aStrRev, ".")
sAfterRev = Replace(sAfterRev, ".", "")
fStringReverse = sAfterRev

End Function

Is This Answer Correct ?    0 Yes 0 No

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

Answer / anwar basha

str="236"

for i=1 to len(str)
a=right(str,i)
temp=temp&left(a,1)
next
msgbox temp

Is This Answer Correct ?    0 Yes 1 No

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

Answer / suryanarayan mohanty

Suppose we have number say 123
to find the revesrse of this number use
StrReverse(123).

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More VB Script Interview Questions

Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

0 Answers  


Hi I am having one folder with set of text files now i want to read and write that text files data into QTP. Any help plsss.

1 Answers  


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

0 Answers  


In qtp, how to use XML files for framework. if the XML files are more Efficient than Excel files?

1 Answers  


How to remove the spaces in a string Ex: "this is apple"

5 Answers   Cap Gemini,


Which constant is used for print and display functions and works as same as pressing enter key?

0 Answers  


Could Anybody tell me VBScript for Check if a given number is Prime number-Don't use any Built- in Functions Boolean/int is Prime(int number).. Thanks in advance.

12 Answers   Amazon, Pyroferus,


how to automatically update the sql server2005 database records when insert in vb6?

0 Answers  


how to write validation function for date in vb script

0 Answers  


how to increasing the numbers in a given text box please write a vb script

0 Answers  


Hi, I need to accept user inputs for login at runtime.I know i can use Inputbox but how to proceed further that i dont know. Thanks in advance

2 Answers  


In our application qtp unable to indentify the menu items,we tried number of times to add objetcs into object repository but fail. through normal recording mode only objects going to add into repository but while running same recording script qtp showing a error like " unable to indentify the object". in repository there is no any properties and pro values for that object and also i tried with virtual object config also unable to find the object in application and in repository. Then what i have to do to identify menu objects????? can anybody hell me pls..............

2 Answers   Blue Star,


Categories