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
Why should spain go to Africa ​
uysha [10]

Answer:

to learn about their cultural heritage and historical significance

3 0
4 years ago
Which part of the cryosphere comes directly from the atmosphere?
marin [14]
The answer to this question is C.
4 0
3 years ago
Read 2 more answers
How can users create a shortcut to favorite websites and store them in their browser?
8090 [49]
I know the first one is A) Bookmark sites and I think the second one is B) Cross-platform capability. 
8 0
3 years ago
Read 2 more answers
"what do you perform when you want to recall specific records from a database"
Ivan
A select query


select column1, column2, columnN
from table
where condition
order to be pretty;
5 0
3 years ago
What is HDLC flow control?​
Likurg_2 [28]
HDLC is a synchronous Data Link layer bit-oriented protocol developed by the International Organization for Standardization (ISO).
6 0
3 years ago
Other questions:
  • A block style business letter is:
    5·1 answer
  • Write a function that will alphabetize a string WITHOUT using the sort function :
    7·1 answer
  • RFID tags uses memory that is read-only.A. TrueB. False
    5·1 answer
  • Where do i put the lines?
    11·1 answer
  • Who is gossip girl.....
    8·2 answers
  • What is drop shipping and how it works on amazon?
    12·1 answer
  • Explain the main components of a computer system​
    12·1 answer
  • How does Shakespeare immediately introduce Tybalt as a menacing character?
    9·1 answer
  • A company is acquiring a smaller firm and is setting up a new IT system in order to consolidate the data and assets of the acqui
    11·1 answer
  • How is video compression accomplished?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!