+++ /dev/null
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-\r
-struct Node \r
-{\r
- float f;\r
- struct Node* next;\r
-};\r
-\r
-void IterateList (struct Node* HeadList);\r
-struct Node* makelist(struct Node** Head, struct Node** Tail);\r
-\r
-struct Node* makelist(struct Node** Head, struct Node** Tail)\r
-{\r
- struct Node* new = (struct Node *)malloc(sizeof (struct Node));\r
- new->next = NULL;\r
-\r
- if (*Head == NULL)\r
- {\r
- *Head = new;\r
- *Tail = *Head;\r
- }\r
- else\r
- {\r
- (*Tail)->next = new;\r
- *Tail = new;\r
- }\r
- return (new);\r
-}\r
-void IterateList (struct Node* HeadList)\r
-{\r
- struct Node* current = HeadList;\r
-\r
- while (current != NULL)\r
- {\r
- printf("The float you entered is %f\n",current->f);\r
- current = current->next;\r
- }\r
-}\r
-int main(void)\r
-{\r
- struct Node* head = NULL;\r
- struct Node* tail = NULL;\r
- struct Node* curr = NULL;\r
- int i;\r
-\r
- for(i=0; i < 20; i++)\r
- {\r
- /* create node */\r
- curr = makelist(&head,&tail);\r
- printf("Enter float :\n");\r
- scanf("%f", &(curr->f));\r
- }\r
-\r
- /* now iterate the list */\r
- IterateList(head);\r
-\r
- return 0;\r
-}\r