wohhie
7/23/2016 - 1:08 PM

//LinkedList Insert & display

//LinkedList Insert & display


//LinkedList code 
//insert and display list

#include <stdio.h>
#include <cstdlib>


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


typedef struct Node item;


int main() {

	item *curr, *head;
	int i;
	head = NULL;

	for (i = 1; i < 10; i++) {
		curr = (item *)malloc(sizeof(item));
		curr->val = i;
		curr->next = head;
		head = curr;
	}


	curr = head;
	printf("\n");
	while (curr) {
		printf("%d->", curr->val);
		curr = curr->next;
	}

	printf("NULL");
	printf("\n");


	return 0;
}