PDA

View Full Version : help

shneyvas
Dec 1st, 2014, 10:16 AM
I need to do the next mission :

get any number that is not between -10 and 10 to receive "wrong"
this part i did:

var x=prompt(" Number","")*1;

if (x<-10 || x>10)
{
}

the second part is all the numbers that is between -10 and 10
will respond like that:
if x=5
0,1,2,3,4,5
if x=-7
then it will show 0,-1,-2,-3,-4,-5,-6,-7

how do i do that?

Philip M
Dec 1st, 2014, 11:22 AM
Again, sounds like homework. This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose.