An Overview

All the necessary study material for b-tech students.

What we have to offer you.

Codes,Syllabus,Study material,Lab manuals,Assignments and many more . . .

Surfing becomes easy.

You can have any material from our website and post your valuable comments for further improvement.

Get the latest techno news

Get yourself updated with this fast changing dynamic world and all the changes in b-tech pattern.

All the best resources for you.

We have done our level best to provide you with the best of the degree and thus this site is devoted to b-tech exclusively.

Showing posts with label UNIX. Show all posts
Showing posts with label UNIX. Show all posts

31 December 2011

Program in UNIX to generate Fibonacci series

$ cat>fibonacci.sh
echo enter value of n
read n
A = 0
B = 1
I = 3
echo $A
echo $B
C = ‘expr $A + $B’
while [ $i -1e $n ]
do
echo $C
A = $B
B = $C
C = ‘expr $A + $B’
i = ‘expr $i + 1’
done

30 December 2011

A program in UNIX to check if a number a is prime or not

$ cat>prime.sh
echo enter value of n
read n
flag = 0
k = 2
f = ‘expr $n\ /2’
while [ $k –ne $f ]
do
m = ‘expr $n \% $k’
If [ $n –eq 0]
then
flag = 1
echo the number is not prime
break ;
fi
k = ‘expr $k +1’
done
If [ $flag –eq 0]
then
echo the number is prime
fi

26 December 2011

UNIX shell script to find the factorial of given number

$ cat>factorial.sh
echo enter value of n
read n
If [$n –eq 0]
then
echo factorial of given number is 1
fi
If [$n -1t 0]
then
echo factorial of given number is not possible
else
temp = ‘expr $n – 1’
while [ $temp –gt 1]
do
$n = ‘expr $n \* $temp’
temp = ‘expr $temp – 1’
done
echo factorial of given number is $n
fi