/* program to fibo series */
# include <stdio.h>
void main ()
{
int counter = 0 ;
int a=0,b=1,sum ;
clrscr ()
printf ("\n %d",a) ;
printf ("\n%d",b) ;
while ( counter<6 )
{
sum =a+b ;
printf ("\n %d",sum) ;
a=b ;
b=sum ;
counter++ ;
}
getch () ;
}
# include <stdio.h>
void main ()
{
int counter = 0 ;
int a=0,b=1,sum ;
clrscr ()
printf ("\n %d",a) ;
printf ("\n%d",b) ;
while ( counter<6 )
{
sum =a+b ;
printf ("\n %d",sum) ;
a=b ;
b=sum ;
counter++ ;
}
getch () ;
}
No comments:
Post a Comment