Clarissa M.
asked 07/22/21
NEED HELP ASAP! How to print numbers from 1 to 100 in decreasing order using for loop and while loop.
- Using Linux
- Using bash script
Patrick B.
answered 07/22/21
Math and computer tutor/teacher
try these...
#!/bin/bash
for (( c=1; c<=5; c++ ))
do
echo "Welcome $c times"
done
#!/bin/bash
for ((c=100; c>0; c--))
do
echo "Number $c Loop"
done
!/bin/bash
x=1
while [ $x -gt 1 ]
do
echo "Welcome $x times"
x=$(( $x - 1 ))
done
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.