In future, I'd suggest you say what your problem is as well as what your code does!
But, the first problem I see lies here:
if (answer==document.adding)
That doesn't make sense. A better layout would possibly be something along these lines.
function maths()
{
var response;
var answer;
answer = document.questions.answer.value;
if ([COLOR="SandyBrown"]Number([/COLOR]answer[COLOR="SandyBrown"])[/COLOR]==sum)
{
response = "correct";
}
else
{
response = "wrong";
}
document.questions.result.value = response ;
}
function randoms()
{
rndNum = Math.random();
Num = [COLOR="Red"]Math.round([/COLOR]rndNum*20[COLOR="Red"])[/COLOR];
Num1=[COLOR="Red"]Math.round([/COLOR]rndNum*10[COLOR="Red"])[/COLOR];
sum = Num+Num1;
document.write(Num+"+"+ Num1);
}
function adding()
{
document.write(sum);
}
Unchecked, so I'm unsure if it works.
BTW, do you want it always to be a pair like, 20+10,19+9,18+9,17+8 etc.? If not, you need two random numbers.
Also, I would advise that you get into the habit NOW of indenting your code correctly, or learn to use an editor that will do so for you. It will help! And in the future, you won't want to be using implied global variables like you are now.