/*
Name: WAP to generate fibonacci series
Author: Parveen Malik
Date: 18/09/11 01:08
*/
#include<stdio.h>
#include<conio.h>
int main(void)
{
int f=0,s=1,temp,num,count;
printf("Enter the value upto which series is to be generated :");
scanf("%d",&num);
count=3;
printf("%5d%5d",f,s);
while(count<=num)
{
temp=f+s;
printf("%5d",temp);
f=s;
s=temp;
count++;
}
getch();
return 0;
}
OUTPUT :
0 comments:
Post a Comment