HOME

Monday, November 7, 2016

WML program to Find Odd or Even number using script

#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);
if(n%2==0)
{
Dialogs.alert("IT is even Number");
}
else
{
Dialogs.alert("It is odd Number");
}
}

No comments:

Post a Comment