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 coding section. Show all posts
Showing posts with label coding section. Show all posts

15 June 2012

A program in c to generate Fibonacci series


#include<stdio.h>

#include<conio.h>

void main()

{

int a =0,b=1,c,i=2,n;

clrscr();

printf("Enter N Value : ");

scanf("%d",&n);

printf("%d\t%d\t",a,b);

while(n>i)

{

c = a+b;

printf("%d\t",c);

c=b;

b=a;

i++;

}

getch();

}


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

25 December 2011

A program in FORTRAN to calculate the velocity and height of a projectile

Given its initial height, initial velocity, and constant acceleration. Variables used are:
HGT0: initial height
HGT: height at any time
VELC0: initial vertical velocity
VELC: vertical velocity at any time
ACCL: vertical acceleration
TIME: time elapsed since projectile was launched

Input: none
Output: VELC, HGT
REAL HGT0, HGT, VELC0, VELC, ACCL, TIME
ACCL = -9.807
HGT0 = 100.0
VELC0 = 90.0
TIME = 4.3
HGT = 0.5*ACCL*TIME**2+VELC0*TIME+HGT0
VELC=ACCL*TIME+VELC0
PRINT*, ‘AT TIME’, TIME, ‘THE VERTICAL VELOCITY IS’, VELC
PRINT*, ‘AND THE HEIGHT IS’, HGT
END

5 December 2011

To Find Discriminant & Square Roots Of The Equation A simple C++ program.

#include // Header File
#include
int main()
{
long double a,b,c; //
Declaration of value
cout<<"Enter the value of
a :";
cin>>a;
cout<<"Enter the value of
b :"; // Input to be give by
the user
cin>>b;
cout<<"Enter the value of
c :";
cin>>c;
double d=(pow(b,2)-4*a*c);
// mathematical fuction
if (d==0)
{
cout<<"The discriminant
is : ";
cout<cout<<"The equation
has single roots";
p=(((-b)+sqrt(d))/(2*a));
n=(((-b)-sqrt(d))/(2*a));
cout<<"The roots of the
equation x= ";
}
else if (d>0)
{
cout<<"The discriminant
is : ";
cout<cout<<"The equation
has two roots";
p=(((-b)+sqrt(d))/(2*a));
n=(((-b)-sqrt(d))/(2*a));
cout<<"The roots of the
equation x= ";
}
else
{
cout<<"The discriminant
is : ";
cout<cout<<"The equation
has complex roots";
}
cout<< p; // output to be
generated
cout<<";";
cout<< n<< endl<
return 0;
}