Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- typedef struct Node
- {
- double y;
- char x;
- struct Node*next;
- }node;
- int main()
- {
- node*head=(node*)malloc(sizeof(node));
- head->x='A';
- head->y=7.99;
- head->next=(node*)malloc(sizeof(node));
- head->next->x='Z';
- head->next->y=2.05;
- head->next->next=(node*)malloc(sizeof(node));
- head->next->next->x='X';
- head->next->next->y=3.69;
- head->next->next->next=NULL;
- node*current=head;
- while(current!=NULL)
- {
- printf("%c %d\n", current->x, current->y);
- current=current->next;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement