Question:

Program that displays a pyramid using loop..

by  |  earlier

0 LIKES UnLike

can you plz show me the code in C... that displays a pyramid.. using for loop...

 Tags:

   Report

1 ANSWERS


  1. include <stdio.h>

    main()

    {       int fib[24];

            int i;

            fib[0] = 0;

            fib[1] = 1;

            for(i = 2; i < 24; i++)

                    fib[i] = fib[i-1] + fib[i-2];

            for (i = 0; i < 24; i++)

                    printf("%3d   %6d\n", i, fib[i]);

    }

    Fibonaci series program

    Hope this helps

    Cheers:)

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.