Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

C Program for Fibonacci Series | C Programming

C Programming | Fibonacci Series

The phrase, “the Fibonacci sequence” usually refers to a set of numbers that starts as {0, 1, 1, 2, 3, 5, 8, 13, 21…}. At least, “The Life and Numbers of Fibonacci” starts with “zero and one”. Many others would skip the zero and simply start with “one and one”, but that does not matter.
This sequence is created by following two rules:
  • The first two numbers are 0 and 1.
  • The next number is the sum of the two most recent numbers.

Actually, one must perform rule #2 over and over again, until one runs out of time, patience, paper or ink in the pen.
So, constructing the Fibonacci sequence starts from 1=1+0, then 2=1+1, then 3=2+1, then 5=3+2, 8=5+3, and so on.

C Program for Fibonacci Series

#include <stdio.h>
#include <conio.h>

int fibonacci(int term);
int main()
{
    int terms, counter;
    printf("Enter number of terms in Fibonacci series: ");
    scanf("%d", &terms);
    /*
     *  Nth term = (N-1)th therm + (N-2)th term;
     */
    printf("Fibonacci series till %d terms\n", terms);
    for (counter = 0; counter < terms; counter++)
    {
        printf("%d ", fibonacci(counter));
    }
    getch();
    return 0;
}
/*
 * Function to calculate Nth Fibonacci number
 * fibonacci(N) = fibonacci(N - 1) + fibonacci(N - 2);
 */
int fibonacci(int term)
{
    /* Exit condition of recursion*/
    if (term < 2)
        return term;
    return fibonacci(term - 1) + fibonacci(term - 2);
}


C Code to Find Fibonacci Series 


#include <stdio.h>
int main()
{
    int i, first = 0, second = 1, third, n;
    printf("Enter number of terms \n");
    scanf("%d", &n);
    printf("The First terms of fibonisse series are:");
    for (i = 0; i < n; i++)
    {
        if (i <= 1)
        {
            third = i;
        }
        else
        {
            third = first + second; // This changes the values.
            first = second;
            second = third;
        }
        printf("%d\n", third);
    }
    return 0;
}

Comments

Popular posts from this blog

Eliminating Epsilon transition (ε-Transitions) | Conversion of Epsilon-NFA to DFA | Conversion of Epsilon-NFA to NFA | Theory Of Computation (TOC)

C program to Find Cartesian Product of Two Sets | C programming

Top 10 Programming Language to learn in 2023