Question 26:
var purchase = parseInt(prompt("How many do you want? "));
var check =
Number.isInteger(purchase);
while(!check)
{
purchase =
parseInt(prompt("Enter a whole number:"," "));
check =
Number.isInteger(purchase);
}
Output:
Question 28:
var myNumber = parseInt(prompt("Enter a whole number:","
"));
var check = myNumber%2;
if(check!=0)
alert("Odd
number");
else
alert("Even
number")
Output:
926.html 1 x + E o → C Apps File | /home/devil/Desktop/course/426.html Top 17 Favourite... > X Download gangs... Chegg India - Ex... C Expert Q&A Ch... This page says How many do you want? Click it Cancel OK - X -/Desktop/course/q26.html - Sublime Text (UNREGISTERED) Goto Tools Project Preferences Help File Edit Selection Find View q26.html <body> <button onclick="test() ">Click It</button> </body> <script type="text/javascript"> function test() var purchase = parseInt(prompt("How many do you want? ")); var check = Number.isInteger(purchase); while(!check) purchase = parseInt(prompt("Enter a whole number:","")); check = Number.isInteger(purchase); * 4 E 22:47
926.html 1 x + E o → C Apps File | /home/devil/Desktop/course/426.html Top 17 Favourite... > X Download gangs... Chegg India - Ex... C Expert Q&A Ch... This page says Enter a whole number: Click it Cancel OK - X -/Desktop/course/q26.html - Sublime Text (UNREGISTERED) Goto Tools Project Preferences Help File Edit Selection Find View q26.html <body> <button onclick="test() ">Click It</button> </body> <script type="text/javascript"> function test() var purchase = parseInt(prompt("How many do you want? ")); var check = Number.isInteger(purchase); while(!check) purchase = parseInt(prompt("Enter a whole number:","")); check = Number.isInteger(purchase); * 4 E 22:47
928.html 1 x + E o → C Apps O File | /home/devil/Desktop/course/428.html Top 17 Favourite... > X Download gangs... Chegg India - Ex... C Expert Q&A Ch... This page says Enter a whole number: Click it Cancel OK ~/Desktop/course/428.html. - Sublime Text (UNREGISTERED) Edit Selection Find View Goto Tools Project Preferences Help - % File q28.html <title></title> </head> <body> <button onclick="test()">Click It</button> </body> <script type="text/javascript"> function test(). var myNumber = parseInt(prompt("Enter a whole number:"," ")); var check = myNumber%2; if(check != 0) alert("Odd number"); else alert("Even number") 19 </script> O Line 14, Column 21 Tab Size: 4 HTML 01 OGOS * m ) E 22:26
928.html 1 x + E o → C Apps O File | /home/devil/Desktop/course/428.html Top 17 Favourite... > X Download gangs... Chegg India - Ex... C Expert Q&A Ch... This page says Odd number Click it OK - ® ~/Desktop/course/428.html. - Sublime Text (UNREGISTERED) Edit Selection Find View Goto Tools Project Preferences Help File q28.html <title></title> </head> <body> <button onclick="test()">Click It</button> </body> <script type="text/javascript"> function test(). var myNumber = parseInt(prompt("Enter a whole number:"," ")); var check = myNumber%2; if(check != 0) alert("Odd number"); else alert("Even number") 19 </script> O Line 14, Column 21 Tab Size: 4 HTML 01 OGOS * m ) E 22:26