Write a C program using a circular linked list to simulate the Josephus problem and find the surviving person’s position.
Two space-separated integers: n (number of people) and k (step count).
Print the surviving person's 1-indexed position.
1 <= n <= 30, 1 <= k <= 10
5 2
3
Create a circular linked list of size n, eliminate every k-th node iteratively until only one node remains, and print its value.
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node *next;
};
int main() {
int n, k;
if (scanf("%d %d", &n, &k) == 2) {
// Write your code here to simulate Josephus problem using circular linked list
}
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used