EmbLogic's Blog

fibonnacci series using pointers

#include
2 #include
3 #include
4 int main()
5
6 {
7 int a,b,c,n,t,i;
8 int *ptr;
9
10 i =2;
11 /* a=0;
12 b=1;*/
13 printf(“enter the max range for fibonacci”);
14 scanf(“%d”,&n);
ptr = (int *)malloc(sizeof(n));
17 *(ptr+0)=0;
18 *(ptr+1)=1;
19 while(n>i)
{

15

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>