codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  power  sangelq at 15:47 on Thursday, June 01, 2006
 

I need some help

I am trying to make power calculator

real number is X and index is Y in this case


this is how i started

<!--

var x, y, result

x = prompt("input X")

y = promt("input Y")

for(¨è) {

result = ¨é

}

document.write("<H3> Answer : " + ¨ê + "</H3>")

-->

so what should I put in ¨è, ¨é, ¨ê?

If x is 2 and y is 3, then the screen should show like:

Answer: 8

can someone give me any help/idea?

there may be something to correct in the code i wrote. I am not sure

but I think I am on the right track but I just cant go further


  Re: power  Kausik at 16:47 on Sunday, June 11, 2006
 

Try this piece of code

for (i=1; i <= y; i++)
{
result = result * x;
}

display your result in the output within your H3 tag

ensure you initiate the value of the variable result to 1 before the for loop








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Sorting in ascending - random characters from user
•  Re: Date validation
•  How to use java in javascript-c
•  SQLException : returned refusing to connect
•  Dissappearing Menus
•  connection mysql using servlet
•  Java source for comparing XML files like ExamXML.
•  Java source for comparing XML files like ExamXML.
•  onunload


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006