Friday, 11 August 2017

Assignment 2: Group A


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;
}

22 comments:

  1. FE,Div:A,Batch:A3
    Roll no.:41

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Good teaching we understand very well. roll no 30

    ReplyDelete
  4. Its So Good And Best Programme ......&
    Easy To understood...

    ReplyDelete
  5. good teaching easy to learn digital learning...

    ReplyDelete
  6. Good. Program understood. Clearly batch-A2. Roll no -12

    ReplyDelete
  7. Yes understood.
    A2 batch, roll no21

    ReplyDelete
  8. Nice one easy to understand
    FE(A)
    Roll no - 35

    ReplyDelete
  9. good understood Div-A Roll no.28 batch A2

    ReplyDelete