Question

In: Computer Science

PHP Programming question! Using Loop count from 0 to 300 by 15's ex) 123456789101112131415 161718192021222324252627282930 .....

PHP Programming question!

Using Loop count from 0 to 300 by 15's

ex) 123456789101112131415

161718192021222324252627282930

.....

Solutions

Expert Solution

Code:

<?php
$count = 1; // declaring a variable to iterate
while($count <= 300)  // looping from 1 to 300
{
  echo $count;
  if ($count%15 == 0) { // checking if its a multiple of 15
    echo "\n";  // changing the line
}
  $count++;
}
?>

Output:


Related Solutions

Java Programming Question The problem is to count all the possible paths from top left to...
Java Programming Question The problem is to count all the possible paths from top left to bottom right of a MxN matrix with the constraints that from each cell you can either move to right or down.Input: The first line of input contains an integer T, denoting the number of test cases. The first line of each test case is M and N, M is number of rows and N is number of columns.Output: For each test case, print the...
Solve for Ex and Ey using these two formulas: 1.2-Ex(0.6)+2Ey = 0 and 2Ey-Ex(0.6) = 1.2...
Solve for Ex and Ey using these two formulas: 1.2-Ex(0.6)+2Ey = 0 and 2Ey-Ex(0.6) = 1.2 Please show all the steps. NOTE: The correct answer for Ex should be 4.25 and Ey should be 1.875. I want to see how they derive the two values.
Please answer the following Question in 300 word count Please answer in your own Count. if...
Please answer the following Question in 300 word count Please answer in your own Count. if citing source please add reference at the end of question. You are the chief financial officer (CFO) at a community hospital. One of the comments that has come back from patient surveys is the need for a commercial 24-hour pharmacy within the hospital. In this way, patients or their families will be able to fill prescriptions and begin taking ordered medication right away instead...
Please answer the following Question in 300 word count Please answer in your own Count. if...
Please answer the following Question in 300 word count Please answer in your own Count. if citing source please add reference at the end of question. You are the chief financial officer (CFO) at a community hospital. One of the comments that has come back from patient surveys is the need for a commercial 24-hour pharmacy within the hospital. In this way, patients or their families will be able to fill prescriptions and begin taking ordered medication right away instead...
Please answer the following Question in 300 word count Please answer in your own Count. if...
Please answer the following Question in 300 word count Please answer in your own Count. if citing source please add reference at the end of question. You are the chief financial officer (CFO) at a community hospital. One of the comments that has come back from patient surveys is the need for a commercial 24-hour pharmacy within the hospital. In this way, patients or their families will be able to fill prescriptions and begin taking ordered medication right away instead...
Using the programing language of Verilog I attempted to make a counter to count from 0...
Using the programing language of Verilog I attempted to make a counter to count from 0 to 9 then loop back to 0 using the internal clock of the FPGA cyclone IV from altera. the code is posted at the bottom I get the following errors Error (10663): Verilog HDL Port Connection error at Encryption.v(9): output or inout port "clk" must be connected to a structural net expression Error (10285): Verilog HDL Module Instantiation error at Encryption.v(9): instance "" specifies...
Count the number of 1’s and 0’s Write a MIPS program that will ask the user...
Count the number of 1’s and 0’s Write a MIPS program that will ask the user to enter an integer, and then output the number of 1’s and 0’s that are present in the integer’s signed 32-bit binary representation. For example, 15 has a binary representation of 0000 0000 0000 0000 0000 0000 0000 1111, which has 28 zeroes and 4 ones. We have provided you the starter code that deals with the input/output logic. The integer input is saved...
How can I make my php code without using the money format just loop and if...
How can I make my php code without using the money format just loop and if statements print like this: Change for 5 dollars and 20 cents: 0 ten dollar bills 1 five dollar bills 0 one dollar bills 0 quarters 2 dime 0 nickel 0 pennies I am trying to ask the user to enter amount and output their change they entered. $input; $TenBills = 1000; $FiveBills = 500; $OneBills = 100; $Quarters = 25; $Dimes = 10; $Nickels...
In this programming question, n integers ranging from 0 to n-1 are stored randomly in A,...
In this programming question, n integers ranging from 0 to n-1 are stored randomly in A, an array of size n. In the class Sort.java, you are supposed to implement the following two sorting algorithms: Insertion-sort and Heap-sort. You have to work directly on the given starter code. Download the starter code from the course web site. Read the starter code and make sure you understand how it works before attempting to modify it. In the given class Sort.java, Selection-sort...
Please discuss the following question in your own word 300 word count on the following question....
Please discuss the following question in your own word 300 word count on the following question. Continuous process improvement is a significant step in Kotter's last step "make it stick". The last step defines the cultural change for the organization and is marked by employee buy-in, leadership's ability to motivate staff towards change, and redefining the organization's position on the "process change". As a future health care leader you create the vision and point your staff to the path towards...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT