Aim:Write a C program to generate first 20 Fibonacci numbers..
Theory : In Fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc.
Program:
#include<stdio.h>
int main()
{
int a=0,b=1,c,count=2;
printf("%d\t",a);
printf("%d\t",b);
while(count!=20)
{
c=a+b;
count++;
printf("%d \t",c);
a=b;
b=c;
}
return 0;
}
FE,Div:A,Batch:A3
ReplyDeleteRoll no.:41
This comment has been removed by the author.
ReplyDeleteGood teaching we understand very well. roll no 30
ReplyDeleteIts So Good And Best Programme ......&
ReplyDeleteEasy To understood...
good teaching easy to learn digital learning...
ReplyDeleteGood. Program understood. Clearly batch-A2. Roll no -12
ReplyDeleteSorry. Roll 17
DeleteYes understood.
ReplyDeleteA2 batch, roll no21
Well understood...
ReplyDeleteNice one easy to understand
ReplyDeleteFE(A)
Roll no - 35
Good understood
ReplyDeletegood understood Div-A Roll no.28 batch A2
ReplyDeletenice understood.
ReplyDeleteNice.good understand.
ReplyDeleteEasy way to understand
ReplyDeleteWell understood
ReplyDeleteEasy to understand
ReplyDeleteBest understood
ReplyDeleteGood understand
ReplyDeleteunderstood
ReplyDeleteunderstood
ReplyDeleteUnderstood
ReplyDelete