C program Fibonacci Series Triangle | simple c program examples

What is c programming?

C programming is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.
Although C programming was designed for implementing system software,It is also widely used for developing portable application software.
C programming is one of the most popular programming languages of all time and there are very few computer architectures for which a C compiler does not exist. C programming has greatly influenced many other popular programming languages.

tutorial for c,c examples source code,simple examples of c programs,simple c program examples

Bellow is c program example for c programming practice

C source codes for Fibonacci Series triangle

/**********************************************
      This program display Fibonacci Series triangle.
      author-Nikunj v Gandhi
      from-gujarat(surat)
      Web Developer(PHP ZCE)
      email-nik_gandhi007@yahoo.com
      http//my-source-codes.blogspot.com
      ************************************************/
       
        #include<conio.h>
 #include<stdio.h>
 void main()
 {
  int n,n1,i,j,k;
  int w,s,d=0,l;
  w=1;
  s=0;
  clrscr();
  printf("enter the value of n,n1? ");
  scanf("%d""%d",&n,&n1);
  clrscr();
  for (i=1;i<=n;i++)
   {
     clrscr();
     for(j=n;j>=i;j--)
     {
      printf(" ");
     }
     for(k=1;k<=i;k++)
     {
      for(l=1;l<=i;l++)
      {
       d=w+s;
       printf("%d",d);
       w=s;
       s=d;
       }
       printf("n");
      }
   }
           }

Buy Me a Beer-If you are like this post

 If you does not have paypal account create free account create account

No comments:

Post a Comment

Post a Comment