#WML FILE
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="card1">
<p>
<do type="accept" label="Check Number">
<go href="prime.wmls#check()"/>
</do>
</p>
</card>
</wml>
#WMLS SCRIPT FILE
extern function check()
{
var num=Dialogs.prompt("Enter Number",0);
var n=Lang.parseInt(num);
var rev=0;
var number=n;
while(n>0)
{
var rem=n%10;
rev=rem+rev*10;
n=n div 10;
}
Dialogs.alert("The reverse of "+number+" is "+rev);
}
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="card1">
<p>
<do type="accept" label="Check Number">
<go href="prime.wmls#check()"/>
</do>
</p>
</card>
</wml>
#WMLS SCRIPT FILE
extern function check()
{
var num=Dialogs.prompt("Enter Number",0);
var n=Lang.parseInt(num);
var rev=0;
var number=n;
while(n>0)
{
var rem=n%10;
rev=rem+rev*10;
n=n div 10;
}
Dialogs.alert("The reverse of "+number+" is "+rev);
}
No comments:
Post a Comment