Write a shell script to Accept number and check the number is even or odd, finds the length of the number, sum of the digits in the number.
clear
echo "Enter Number : "
read no
count=0
total=0
if [ `expr $no % 2` -eq 0 ]
then
echo "NUMBER IS EVEN"
else
echo "NUMBER IS ODD"
fi
while [ $no -ne 0 ]
do
a=`expr $no % 10`
no=`expr $no / 10`
total=`expr $total + $a`
count=`expr $count + 1`
done
echo "Sum of All Digit : $total"
echo "Total No. of Digit : $count"
echo "Enter Number : "
read no
count=0
total=0
if [ `expr $no % 2` -eq 0 ]
then
echo "NUMBER IS EVEN"
else
echo "NUMBER IS ODD"
fi
while [ $no -ne 0 ]
do
a=`expr $no % 10`
no=`expr $no / 10`
total=`expr $total + $a`
count=`expr $count + 1`
done
echo "Sum of All Digit : $total"
echo "Total No. of Digit : $count"
Labels:
shell script
Subscribe to:
Post Comments (Atom)
Subjects
- WordPress
- Mobile Computing-4649303 Practical Solution
- Android Programming New Syllabus Theory
- PHP LAMP Question Bank
- PHP LAMP Theory
- Step by Step Android Example
- Android Practical
- Android Theory
- Android Question Bank
- Networking FON Practical
- Networking FON Theory
- OS Practical
- OS Theory
- HTML
- JavaScript
- J2EE WTAD Theory
- J2EE WTAD Question Bank
- J2EE WTAD Quick Guide
- J2EE WTAD GTU Papers
- J2EE WTAD Practical
- Python
- JAVA Theory
- JAVA Practical
- MIS
Categories
- Android (55)
- c (11)
- Configure Tomcat7 (2)
- CSS (3)
- Decryption (16)
- Difference (1)
- Encryption (16)
- Error Detection and Correction Techniques (3)
- FON (27)
- Framing Technic (2)
- install Tomcat (2)
- J2EE (29)
- JAVA (13)
- JavaScript (19)
- linux (8)
- OS (17)
- PHP (11)
- Protocol (3)
- SERVER SOCKET PROGRAMING (7)
- Servlet (13)
- shell script (33)
- unix (22)
- WTAD (34)
Blog Archive
-
▼
2012
(79)
-
▼
August
(9)
- Write a script to copy the file system from two di...
- Write a shell script to broadcast a message to a s...
- Write a shell script to find the global complete p...
- write a shell script to fetch the data from a file...
- Write a shell script to accept filename and displa...
- Accept strings and replace a string by another string
- Write a shell script to Accept number and check th...
- Write a shell script to accept the string and chec...
- Write a shell script to accept numbers and perform...
-
▼
August
(9)
Total Pageviews
© BipinRupadiya.com. Powered by Blogger.
4 comments:
There are lots of information about latest technology and how to get trained in them, like UNIX Training in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(UNIX Training Centers in Chennai). By the way you are running a great blog. Thanks for sharing this.
UNIX Training Centers in Chennai | UNIX Course Chennai
Thanks for sharing this valuable post.
Regards,
Unix Training in Chennai | Unix course in Chennai | Unix Training institutes in Chennai
Good post..
SAP CS training
SAP mm training
SAP pm training
SAP PP training
azure devops training
app v training
sccm training
windows admin training
mysql training
azure training
web methods training
Post a Comment