Jump to content

ajeet

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by ajeet

  1. Thanks for your reply....Can you tell wat is t difference b\w "type="text\vbscript" and language="text\vbscript".many programs are running only using the second format.Too the code below is not doing the addition to calculate the fibonacci series...can you plz help- <html><head><script type="text\vbscript">function fib(n)if (n=0) or (n=1) thendocument.write("zero")exit functionend ifif (n=2) thendocument.write("one")exit functionend ifdim old,current,new,jold=cint(0)current=cint(1)document.write(old & "<br>" & current & "<br>" )for j=3 to n step 1new = old + currentdocument.write(new &"<br>")nextend function</script></head><body><form name="form">Enter the number of terms to calculate:<input type="text" name="t1"><br><input type="button" value="click" OnClick="fib(form.t1.value)"></form></body></html>
  2. The program below is to calculate simple interest using vbscript-Do we have to use cint also?<html><head><script type="text/vbscript">function check()dim p,r,s,tp=document.form.t1.valuer=document.form.t2.valuet=form.t3.values=p*r*t/100document.write("the simple interest is "&s)if len(form.t1.value)=0 thenmsgbox"invalid entry to box 1"if len(form.t2.value)=0 thenmsgbox"invalid entry to box 2"if len(form.t3.value)=0 thenmsgbox"invalid entry to box 3"end ifend ifend if end function</script></head><body><form name="form"><p>principal amount: <input type="text" name="t1"></p>Rate of Interest: <input type="text" name="t2"><br><p>time: <input type="text" name="t3"><br></p><input type="button" value="click" OnClick=check()></form></body></html>
×
×
  • Create New...