trying to make statement by using p.u.t.t.y when you done making statement you w
ID: 3631625 • Letter: T
Question
trying to make statement by using p.u.t.t.y
when you done making statement
you will need to type 'a.out'
then 'put a positive number: ' will appear and you should type 567890
then the output should appear like below
first number: 567890
inverse integer: 098765
Also, when you type 998877665544
it will appear like
first number: 998877665544
inverse integer: 445566778899
when you type negative number, 'you should type positive number' should be appear on the output.
the same result 'you should type positive number' will appear if you type 0 (zero).
I can ONLY use loop function (repitition function) and if/if else function to make this statement
no arrays or the other function
Explanation / Answer
#!/bin/bash/ echo "Enter the number you want to check" read a d=$a if [ '0' -gt $a ] then echo "enter a positive number" else echo $a > wcf n=`echo $a | wc -c` n=`expr $n - 1` p=0 for (( i=0; ia.out echo "check the out put in the file name called a.out" fiRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.