Hello Every one.....
I'm developing a web page to generate 2 random numbers and prompt the values to the user and they need to add those numbers and give the result.
I tried it a lot but the values are not passing to the prompt window...
can anyone help me...

script contains these line:

var a=Math.floor(Math.Random()*6);
var b=Math.floor(Math.Random()*6);
var result=a+b;
var res=prompt(a+" + "+b+");
if(res==result)
    alert("you are correct");
else
    alert("you are wrong");

Can any one help me to resolve this

In lines 1 and 2, try Math.random instead of Math.Random. Also your quotation marks on line 4 are unbalanced.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.