#include<stdio.h>
int main()
{
int a = 0, b = 1, anik, i, n;
printf("Enter Any Number : ");
scanf("%d", &n);
printf("Pell Series : ");
for(i=1;i<=n;i++)
{
printf("%d ", a);
anik = a + b*2;
a = b;
b = anik;
}
return 0;
}
int main()
{
int a = 0, b = 1, anik, i, n;
printf("Enter Any Number : ");
scanf("%d", &n);
printf("Pell Series : ");
for(i=1;i<=n;i++)
{
printf("%d ", a);
anik = a + b*2;
a = b;
b = anik;
}
return 0;
}
Comments
Post a Comment