//fibonacci series using pointers //fibonaci series means start frm whole no.0 & 1 then every new value is added to previous one to form a new value ...here series formed is 0,1,1,2,3,5,8,13,21....so on.......
#include<stdio.h>
int fibo(int*,int*);
int fibo(int *x,int* y)
{
int temp;
temp=*x+*y;//old & new value r added & put into temp variable
*x=*y;//new value is replaced with old value
*y=temp;//adition of two values is put into new value *y
//printf(" %d %d",x,y);
//fibo(x,y);
return 0;
}
int main()
{
static int a=0,b=1,i=0;
printf("%d",a);
for(i=0;i<=5;i++)
{
fibo(&a,&b);//address of a & b is pased to pointers to operate on these values using function