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 First Come First Serve (FCFS) disk scheduling algorithm | C Programming

Introduction to First Come First Serve (FCFS) disk scheduling :

                    The simplest form of disk scheduling is, of course, the first-come, first-served (FCFS) algorithm. This algorithm is intrinsically fair, but it generally does not provide the fastest service. Consider, for example, a disk queue with requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, 67. If the disk head is initially at cylinder 53, it will first move from 53 to 98, then to 183, 37, 122, 14, 124, 65, and finally to 67, for a total head movement of 640 cylinders.



C program for First Come First Serve (FCFS) disk scheduling algorithm


#include <stdio.h>

#include <math.h>

int main()

{

    int queue[20], n, head, i, j, k, seek = 0, max, diff;

    float avg;

    printf("Enter the max range of disk\n");

    scanf("%d", &max);

    printf("Enter the size of queue request\n");

    scanf("%d", &n);

    printf("Enter the queue of disk positions to be read\n");

    for (i = 1; i <= n; i++)

        scanf("%d", &queue[i]);

    printf("Enter the initial head position\n");

    scanf("%d", &head);

    queue[0] = head;

    for (j = 0; j <= n - 1; j++)

    {

        diff = abs(queue[j + 1] - queue[j]);

        seek += diff;

        printf("Disk head moves from %d to %d with seek %d\n", queue[j],
        queue[j + 1], diff);
    }

    printf("Total seek time is %d\n", seek);

    avg = seek / (float)n;

    printf("Average seek time is %f\n", avg);

    return 0;
}

You May Also Like:

C Program for SCAN disk scheduling algorithm 

C program for First Come First Serve (FCFS) disk scheduling algorithm | C Programming


C program for Shortest Seek Time Next Disk Scheduling Algorithm | C Programming


C++ program for LOOK Disk Scheduling Algorithm | C++ Programming


C Program for C-SCAN Disk Scheduling Algorithm | C Programming


C++ Program For C-LOOK Disk Scheduling Algorithm | C++ Programming



Comments

Popular posts from this blog

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

Array in C Programming | C Programming

What is System? | SAD