1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elden [556K]
3 years ago
9

PHP Create a for loop that initialize with the variable $i = 10 The loop outputs $i as long as $i is greater than 1 using for lo

op Use echo statement to output $i Make sure to use operator based on the desired condition mentioned (increment $i++ / decrement $i–) Make sure each line of code ends with a semi colon i.e ;
Computers and Technology
1 answer:
Tanzania [10]3 years ago
4 0

Answer:

The PHP code is as follows

<?php

for ($i = 10; $i>1; $i--)

{

echo $i.' ';

}

?>

Explanation:

The code is self explanatory and doesn't require comments before it can easily understood.

The program starts with a php opening tag <?php

And it ends with the closing tag ?>

The interpretation of the question is to print integer values from 10 to 1

To do this, an iteration is needed.

The above program makes use of a for loop iteration.

Analysis;

for ( -> This shows that it is a for loop iteration

$i = 10; -> Iterating variable $i is initialized to 10 (that is; printing will start at 10)

$i>1; -> Iteration is valid while $i is greater than 1 (e.g. 2,3,4...10)

$i-- -> For every Iteration, decrease $i by 1

) -> End of Iterating condition

echo $i.' '; -> This line prints the valid values of $i. In this case, the values of $i is from 10 and stops at 2

The output is as follows

10 9 8 7 6 5 4 3 2

You might be interested in
Which type of security software prevents, detects, and removes the malware program that tries to collect personal information or
kupik [55]

Answer:

Windows Defender Using Security Updates and Antivirus Software for Clients

Explanation:

Windows Defender is a software product from Microsoft that is intended to prevent, remove, and quarantine spyware in Microsoft Windows. This program helps protect your computer against pop-ups, slow performance, and security threats caused by spyware and other unwanted software by detecting and removing known spyware from your computer.

7 0
3 years ago
Read 2 more answers
Rachael has been posting negative comments on several of her peers' social media pages. Which of the six Ps is Rachael abusing?
posledela
The answer is D. Personification
4 0
3 years ago
Which of the following lists the proper order of the categories of the SOC system from general to specific?
muminat

Answer:

C

Explanation:

6 0
3 years ago
Vpns create a _____________ to transport information through public communications media.
Oxana [17]

They create a secure tunnel.

3 0
3 years ago
Aapke question about computer keyboard​
Lapatulllka [165]

Explanation:

A computer keyboard is an input device that allows a person to enter letters, numbers, and other symbols (these are called characters in a keyboard) into a computer. It is one of the most used input devices for computers. Using a keyboard to enter lots of data is called typing

8 0
3 years ago
Other questions:
  • Which of the following represent typical account fees?
    7·1 answer
  • In what stage of writing does publishing occur
    14·1 answer
  • A network administrator is using packet tracer to mock up a network that includes iot devices. What can the administrator do fro
    15·1 answer
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    7·1 answer
  • Explain the third <br> generation
    6·1 answer
  • 100 tickets are sold in a raffle with one prize. John has 8 tickets, Jamie has 10 tickets, find the probability that John wins
    11·2 answers
  • What is the answer 11100+01010​
    8·1 answer
  • Explain the three schemes via which the binding of instructions and data to memory addresses can be done. In each scheme, how th
    13·1 answer
  • How would you use keywords and Boolean operators to help you with a web search?
    13·1 answer
  • // This pseudocode is intended to describe
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!