|
|
 |
RE: FN-FORUM: javascript beginner
date posted 24th January 2006 10:37
Your script is slightly wrong but also you need to load it in a html page.
var biggestNumber;
var theSum=0;
biggestNumber=window.prompt('Please input a value ','');
biggestNumber=parseFloat(biggestNumber);
for (count = 1; count I'm just doing a course on javascript (total javascript
> beginner) and wrote
> the following lines:
>
> var biggestNumber;
> var theSum=0;
>
> biggestNumber=window.prompt('Please input a value ','');
> biggestNumber=parseFloat(biggestNumber);
> for(var count = 1; count {
> theSum = theSum + count
> window.alert('The sum of the numbers from 1 to ' +
> biggestNumber + ' is ' +
> theSum)
>
> Now the next calculation I'm supposed to do is: to calculate
> the sum of the
> numbers from 1 to 10,000, and I need to post the result of the output.
>
> Where and how do I test my program? I wrote it in notepad and
> tried viewing
> it in a browser, but must be doing something wrong? Sorry,
> this is probably
> a really silly question, but I'm kind of stuck.
>
> Thanks in advance for your patience,
>
> Regards Gina
|
 |
|