Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to implement a simple linked list and display its elements.

Hard

Problem Statement

Write a program to implement a simple linked list and display its elements.

Sample Input

Insert(10), Insert(20), Insert(30)

Sample Output

Linked List: 10 -> 20 -> 30 -> NULL

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node *next; }; void insert(struct Node **head, int data); int main() { struct Node *head = NULL; // Logic to insert and display linked list return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
Insert(10), Insert(20), Insert(30)
Expected Output
Linked List: 10 -> 20 -> 30 -> NULL