CJCoding With Joseph

Two-Node Linked List

A struct Node holds an int value and a struct Node *next pointer (a self-referential struct). Build a two-node list where the first node has value 1 and points to a second node with value 2 (whose next is NULL). Traverse the list from the head and print the values joined by  -> :

1 -> 2

The two nodes can be plain local variables. There is no trailing newline.

Expected Output:

1 -> 2
Topics:
Structs
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.