Saturday, 12 May 2018

Program to print 8 terms of Fibonacci series in c languages

/* 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 () ;
}

No comments:

Post a Comment

Featured post

Program to find Volume of given box in java

class volume { public static void main (String args []) { int l=5,b=6,h=10; int volume; volume=l*b*h; System.out.println (" vol...