Skip to main content

FIBONACCI SERIES USING LOOP

Fibonacci series using loop
#include < stdio.h >
int main()
{
  int n, first = 0, second = 1, next, c;
  printf("Enter the number of terms\n");
  scanf("%d",&n);
  printf("First %d terms of Fibonacci series are :-\n",n);
  for ( c = 0 ; c < n ; c++ )
  {
  if ( c < = 1 )
  next = c;
  else
  {
  next = first + second;
  first = second;
  second = next;
  /*replaced first no by second & second by addition of first & second */
  }
  printf("%d\n",next);
  }
  return 0;
}

Comments

Popular posts from this blog

Software

Software The ingredients that enables a computer to perform a specific task is software, Which consist​ of instructions.A set of instructions that drive a computer to perform specific task is called program.These instructions tell the machine physical components what to do,without the instruction a computer couldn't do anything at all.Software that are classified into two category 1.System software 2.Application software

REVERSE NUMBER USING ARRAY

Reverse number using array #include < stdio.h > void main() { int n, array[100], i; printf("Enter no of digits in your number"); scanf("%d",&n); printf("Enter no.") for(i=0,i < n;i++) scanf("%d",&a[i]); /*storing each no in array*/ printf("Reverse no is : "); for(i=n-1,i > =0;i--) printf("%d",a[i]); /*Printing array in reverse order*/ }

Application Software

Application Software tells the computer how to accomplish a specific task such as word-processing or Drawing for the user.Thousands of application are available for many purposes and the some of the major categories are 1.Word-processing Software For creating text based document example MS word 2. Spreadsheet Software For creating numeric based document such as balance sheet example MS Excel 3.Database Management Software For building and manipulating large set of data such as the names, Address and phone numbers in telephone directory Example MS Access 4.Presentation Software For creating and presenting slideshows example MS Power Point 5.Graphics Programs for designing and manipulating photograph for animation 6.Multimedia Application For building digital movie that incorporate sound,video, Animation and interactive features Example windows movie Maker 7.Entertainment and education software . Example any games 8.Web Design tool and web browser and other internet appl...