Posted by: Sourav | February 3, 2012

A simple quiz program using Javascript


quesans=[[‘How many paisa in one rupee?’,100],[‘How many megabyte in one gigabyte?’,1000],[‘How many gigabytes in one terabyte?’,1000]];
var score=0;
for(var i=0;i<quesans.length;i++)
 var j=1;var k=0;
 var ques=(quesans[i]);
 var question=ques[k];
 var ans=(ques[j]);
 var answer=prompt(question,” “);
  var b=i+1;
  alert(“correct answer”);
  alert(“Your score is “+ score +”out of “+b);

  alert(“wrong answer”);
  var b=i+1;
  alert(“Your score is “+ score +” out of “+b);


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: