Computer and Information Technology notes
Home
Programs »
Java Programs
C Programs
Shell Programs
Practical Programs »
Data Structures
Web Programming
ComputerNetwork
DBMS
OperatingSystem
OpenSource(OST)
ComputerGraphic
Microcontroller
Advanced DBMS
SWS
E-books »
First Year
Computer
I.T.
Mumbai University »
Question Paper
Solved Programs
Sitemap
Placements
Shell program - swapping of two numbers without using third variable
CODE:
#! /bin/bash
echo "enter two numbers:"
read a
read b
c=`expr "$a" - "$b" `
echo "$a - $b ="$c
OUTPUT:
Shell program - swapping of two numbers using third variable
CODE:
#! /bin/bash
echo "enter two numbers:"
read a
read b
echo "Before swapping, a=$a and b=$b"
z=$a
a=$b
b=$z
echo "After swapping, a=$a and b=$b"
OUTPUT:
Shell program - Division of two numbers
CODE:
#! /bin/bash
echo "enter two numbers:"
read a
read b
c=`expr "$a" \/ "$b" `
echo "$a / $b ="$c
OUTPUT:
Shell program - Multiplication of two numbers
CODE:
#! /bin/bash
echo "enter two numbers:"
read a
read b
c=`expr "$a" \* "$b" `
echo "$a * $b ="$c
OUTPUT:
Shell program - Subtraction of two numbers
CODE:
#! /bin/bash
echo "enter two numbers:"
read a
read b
c=`expr "$a" - "$b" `
echo "$a - $b ="$c
OUTPUT:
Shell program - Addition of two numbers
CODE:
#! /bin/bash
echo "enter two numbers:"
read a
read b
c=`expr "$a" + "$b" `
echo "$a + $b ="$c
OUTPUT:
open source technology (basic linux programs)
Sr no.
Name of the program
1
Installation of Linux (ubuntu)
2
Introdction to shell programming
3
implementation of the decision making statement in shell script (if ,if else)
4
implementation of the looping statement in shell script (for loop)
Older Posts
Home
Subscribe to:
Posts ( Atom )