#include <stdio.h>
#include <stdlib.h>
#include <iostream>

using namespace std;

struct Node
{
    int data;
    struct Node* next;
};

Node* Insert(Node* head, int data);
Node* print(Node* head);
void ReverseIterative();


Node* Insert(Node* head, int data)
{
    Node* newNode = new Node();
    newNode->data = data;
    newNode->next = NULL;

    if(head == NULL)
    {
        return newNode;
    }

    Node* curr=head;
    while(curr->next!=NULL)
    {
        curr=curr->next;
    }
    curr->next = newNode;
    return head;
}

Node* printList(Node* head)
{
    while(head)
    {
        cout<<head->data;
        head=head->next;
    }
    cout<<endl;
}

int main()
{
    struct Node* head = NULL;
    head = Insert(head, 2);
    head = Insert(head, 4);
    printList(head);
    return 0;
}