Friday 28 September 2012

Linker Program in System Software - Anna University Lab Experiment No 6

Ex:6 Linker

Main program:

#include<stdio.h>
#include<conio.h>
#include"fib.c"
void main()
{
clrscr();
printf("Fibonacci series\n");
fib();
getch();
}

Fibonacci series:

#include<stdio.h>
#include<conio.h>
void fib()
{
int f1=0,f2=1,f3,n,i;
printf("Enter the no. of terms ");
scanf("%d",&n);
printf("%d\n%d\n",f1,f2);
for(i=2;i<n;i++)
{
f3=f1+f2;
printf("%d\n",f3);
f1=f2;
f2=f3;
}
getch();
}

Output:

Fibonacci series

Enter the no. of terms 8

0

1

1

2

3

5

8

13

No comments:

Don't You Think this Awesome Post should be shared ??
| Linker Program in System Software - Anna University Lab Experiment No 6 |
Back To Top Related Posts Plugin for WordPress, Blogger...