#include <stdio.h>
#include <stdlib.h>
typedef struct node_type {
    int data;
    struct node_type *next;
} node;

int main()
{
    typedef node *list;
    list head, temp;
    char ch;
    int n;
    head = NULL;
    printf("enter Data?(y/n)\n");
    scanf("%c", &ch);

    while ( ch == 'y' || ch == 'Y')
    {
        printf("\nenter data:");
        scanf("%d", &n);
        temp = (list)malloc(sizeof(node));
        temp->data = n;
        temp->next = head;
        head = temp;
        printf("enter more data?(y/n)\n");

        scanf(" %c", &ch);

    }
    temp = head;
    while (temp != NULL)
    {
        printf("%d", temp->data);
        temp = temp->next;
    }

    return 0;
}
