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
Practice using filters and tables using this document.
mestny [16]

Answer:

Do you still need help?

Explanation:

4 0
3 years ago
Write a recursive function sumAll that accepts an integer argument and returns the sum of all the integers from 1 up to the numb
slavikrds [6]

Answer:

int sumAll(int n)//function definition.

{

   if(n==1)//if condition.

   return 1;

   else//else condition.

   {

       return n+sumAll(n-1);//return the value and call the function in recursive manner.

   }

}

Explanation:

  • The above-defined function is a recursive type function that is written in the c language, which holds the if and else condition.
  • When the user passes the largest value from 1, then the else condition will be executed which adds the largest value and pass the value after the decrement of the value as an argument.
  • When the value will become 1, then the function if-block will be executed which returns the value and ends the calling function recursively.
8 0
3 years ago
5. Which field will provide an opening for a letter such as “Dear Mr. Smith”?
stepladder [879]
The answer is a greeting line,
3 0
3 years ago
Read 2 more answers
Which of the following forces all traffic, communications, and activities through a single pathway or channel that can be used t
Ad libitum [116K]

Answer:

Option b. Choke point

Explanation:

In firewall, a choke point can be defined as a single point which allows all of the network traffic including incoming and outgoing to be funneled. As the passage of the whole traffic through the choke point regulates the flow as it focus monitoring  and controls bandwidth consumption, provides authentication, control efforts like Internet firewalls.

7 0
3 years ago
hgffhfhnhnfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Svetradugi [14.3K]

Answer: yeah, I know right?

Explanation: totally get you

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which statement best expresses the use of Internet sources in a research project versus other types of sources?
    14·1 answer
  • Suppose you will invest $100 per month at the beginning of the month for 40 years with interest rate
    5·1 answer
  • Low-end CRM systems are designed for companies like Boeing because they only have a few, large customers.
    11·1 answer
  • The challenge of preparing for ____________________ is in ensuring that employees do not feel that they are being prepared for t
    7·1 answer
  • What is Moodle in information communication and Technology?​
    5·1 answer
  • Assume the following:
    10·1 answer
  • bro i got banned for posting an amazing bulk pic, but this dude literally posted an inappropriate, dafuq is wrong with this bann
    8·2 answers
  • What kind of software consists of programs designed to make users more productive and/or assist them with personal tasks?.
    15·1 answer
  • Which statement best describes how the programming layer of abstraction in
    10·1 answer
  • Pictures in the _____ gallery give the appearance of a physical object, such as water drops or sand, that can give your presenta
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!