Monday, October 5, 2020

Fibonacci Numbers in C#

 A C# program that I wrote that will ask the user to give a number and then the program will generate the Fibonacci Numbers sequence.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.

Program Listing

/* fibonacci.cs
 * Author  : Mr. Jake Rodriguez Pomperada, MAED-IT, MIT
 * Date    : October 5, 2020 Monday
 * Website : www.jakerpomperada.com  / www.jakerpomperada.blogspot.com
 * Email   : jakerpomperada@gmail.com
 * Place   : Bacolod City, Negros Occidental Philippines
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fibonacci
{
    class Program
    {
        static void Main(string[] args)
        {
            int term1 = 0, term2 = 1, term3 = 0;
            Console.Write("\n\n");
            Console.Write("\tFibonacci Numbers in C# ");
            Console.Write("\n\n");
            Console.Write("\tGive a Number : ");
            int count = Convert.ToInt32(Console.ReadLine());
            Console.Write("\n\n");
            Console.Write("\t");
            Console.Write(term1 + " ");
            Console.Write(term2 + " ");
            for (int a = 0; a <= count; a++)
            {
                term3 = term1 + term2;
                Console.Write(" "+ term3+" ");
                term1 = term2;
                term2 = term3;
            }
            Console.Write("\n\n");
            Console.Write("\tEnd of Program");
            Console.Write("\n\n");
            Console.ReadLine();
        }
    }
}


No comments:

Post a Comment