Monday, 5 February 2018

Web Programming , Title Bar in html and CSS

Fancy  Title Bar in html and CSS 

index.html

<html>
<head>
<title> Title Bar Demo </title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<ul>
    <li><a href="home.html">HOME</a></li>
    <li><a href="#newcar">NEW CARS</a></li>
    <li><a href="#usedcar">USED CARS</a></li>
    <li><a href="#sellcar">SELL CAR</a></li>
    <li><a href="#buycar">BUY CAR</a></li>
    <li><a href="#login">LOGIN</a></li>
</ul>
</body>
</html>

style.css
--------------

ul{
    list-style-type:none;
    margin:0;
    padding:0;
    overflow:hidden;
    font-family:calibri;
}

a:link,a:visited{
    display:block;
    font-weight:bold;
    color:#FFFFFF;
    background-color:#555fff;
    width:160px;
    text-align:center;
    padding:10px;
    text-transform:uppercase;
    text-decoration:none;
}
a:hover,a:active{
    background-color:#999fff;
}

li{
    float:left;
}





Monday, 10 April 2017

Unix Shell Scripts

------------------------------------------------------------------------
Script 1: Shell script to find the GCD and LCM of two numbers.
------------------------------------------------------------------------
clear
echo Enter two number:
read m n
temp=`expr $m \* $n`
while [ $m != $n ]
do
    if [ $m -gt $n ]
    then
            m=`expr $m - $n`
    else
            n=`expr $n - $m`
    fi
done
echo gcd=$n
lcm=`expr $temp / $n`

echo The LCM is: $lcm
echo The GCD is: $n

output:
$bash gcd_lcm.sh

Enter two number:
2 10
gcd=2
The LCM is: 10
The GCD is: 2

---------------------------------------------------------------------------
Script 2: Shell script to calculate the area of a triangle.
---------------------------------------------------------------------------
clear
echo Enter a base value:
read base
echo Enter the height:
read ht
area=`echo "scale=2; 0.5 * $base * $ht"|bc`
echo the area of the triangle is:$area


output: bash area.sh
Enter a base value:
10
Enter the height:
15
the area of the triangle is:75.0

------------------------------------------------------------------
Script 3: Shell script to find the length of the string
-------------------------------------------------------------------
clear
echo Enter a string:
read str
l=`expr length $str`
echo Length of $str is $l





Enter a String:
youtube
Length of youtube is 7
---------------------------------------------------------------------

Script 4: Shell script to find  the factorial of a number.
---------------------------------------------------------------------
clear
echo "Enter an integer:"
read n
fact=1; i=1
while [ $i -le $n ]
do
    fact=`expr $fact \* $i`
    i=`expr $i + 1`
done
echo Factorial of $n is $fact



Output:
Enter an integer:
5
Factorial of 5 is 120
--------------------------------------------------------------------------
Script 5: #shell script to find if the number is even or odd?

--------------------------------------------------------------------------
clear
echo Enter a number:
read num
if [ `expr $num % 2` -eq 0 ]; then
echo $num is an even
else
echo $num is an odd number.
fi


Output:

Enter a number:
543
543 is an odd number.


2nd Output:
Enter a number:
4574
4574 is an even
-------------------------------------------------------------------------------


for more click the link  

Web Programming , Title Bar in html and CSS

Fancy  Title Bar in html and CSS   index.html <html> <head> <title> Title Bar Demo </title> <link rel=...