Write a code to display multiples of 15, from 15 to 1500 using the same code as below using a WHILE loop
<!DOCTYPE html>
<html>
<body>
<script>
var i=13;
while (i<=79)
{
document.write("The number is ", i);
document.write("<br />");
i = i + 2;
}
</script>
</body>
</html>
Answer)
<!DOCTYPE html>
<html>
<body>
<script>
//i is initialized with 15
var i=15;
//upper limit is said as 1500
while (i<=1500)
{
//multiples of 15 means the number is increased by 15,like
15,30,45,...1500
document.write("The number is ", i);
document.write("<br />");
i = i + 15;
}
</script>
</body>
</html>
Write a code to display multiples of 15, from 15 to 1500 using the same code...
Please help me with the following requirements for JavaScript. Write a function to take a temperature value in Celsius as an argument and return the equivalent temperature in Fahrenheit, basing it on the code from Hour 2. //Original Code <!DOCTYPE html> <html> <head> <title>Fahrenheit From Celsius</title> </head> <body> <script> var cTemp = 100; // temperature in Celsius var hTemp = ((cTemp * 9) /5 ) + 32; document.write("Temperature in Celsius: " + cTemp + " degrees<br/>"); document.write("Temperature in Fahrenheit: "...
Javascript program reformation A. combine three loops into one loop and REPLACE FOR LOOP with a while loop to maintain the same result <!DOCTYPE html> <html><head><title>19.7 For Loop</title> <script language="javascript"> //numbers divisible by 5 for (i=1; i<=50; i++) { if (i%5 == 0) document.write ("number divisible by five is: " + i + "<br />"); } //for document.write ("========================<br />"); //separator //odd numbers divisible by 7 for (i=1; i<=50; i++) { if ((i%7==0) && (i%2!=0)) document.write ("odd number...
What is the problem with this code? <html> <body> <script type="text/javascript"> //Declare variables var numStudents; var index; var sName; var ES = ""; var BR = "<br />"; var PA = "<p />"; //Print statement document.write("Student Name Entry Program" + PA); //Prompt for number of students to add numStudents = prompt("Enter the number of student names to add: "+ ES); //Loop through numStudents of times, prompting for student names for(index = 1; index <= numStudents: index++) { sName = prompt("Enter...
Q2: Write HTML code for the following layout... 4 marks] Participants stu In Phone Course Grade Name ABC XYZ +1 (023) 4585867 BIT123 1 (034) 56789 BIT234 Send email at info@ecmit.ac.ae [6 marks Q3: Write the output of the following codes. A. <script var text = ""; var i 0; while(i < 3) { text +"<br> The number is" +i; document.write(text); </script
Modify this code to store the form elements as variables and display them on the page in an HTML table. <!DOCTYPE html> <html> <head> <script> function getValues() { var result = ""; result += "First Name: " + document.forms["myForm"]["fname"].value + "<br>"; result += "Last Name: " + document.forms["myForm"]["lname"].value + "<br>"; result += "Address: " + document.forms["myForm"]["address"].value + "<br>"; result += "City: " + document.forms["myForm"]["city"].value + "<br>"; result += "State: " + document.forms["myForm"]["state"].value + "<br>"; document.getElementById("output").innerHTML = result; } </script>...
Question: How can this code be rewritten without using
array?
Code in action here:
After Inserting number:
Full code is here:
How would I rewrite this without using built in array or an
array?
C nked list ← ⓘ솔JSFiddle Ltd (GB) https:/JSfiddle.net/7m80w1c5/2/ .Most Visited @ Getting StartedのHP-See what's Hot Suggested Sites . Comments for The Ch web Slice Gallery C New Tab 60 D> Run 9 Update Fork Tidy Collaborate Embed v/ Settings <form> iddle Meta HTML Insert Number Here:<br>...
Create an HTML form that takes these inputs: Number of rows, and number of columns. This form will submit to a PHP page. Create that page that will accept input from the HTML form and generates the table from the user's input. I already have the portion that generates the table based on user input by using Javascript in an HTML page, I just need to know how to generate the table using a PHP page instead. Here's the code...
Please modify the follow source code to also include the following: 1. Add two more flights from these two airlines: United and AA, and makeup all the related information. Make sure the user can pick those flight numbers (United & AA) form the prompt box. 2. Add an array to hold "Departure Time" for all the flights. (Time format: "0800A", "1135P" ...) 3. If the user type in a flight number is not in the flight record, send out a...
using namespace std ; Write C++ code to do the followings: 1-Display the multiples of 3 backward from 33 to 3, inclusive. 2-Display the uppercase letters of the alphabet backward from Z to A. 3-Ask the user to enter letters and convert it to uppercase.